From cd8a4d03904a15cd8994b73f179f5bff391c97fe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Sep 2022 22:24:40 +0200 Subject: [PATCH 01/43] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 (#885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.1` -> `3.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/compatibility-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/confidence-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​302-httpsgithubcomgoogleapisjava-shared-dependenciescomparev301v302-2022-09-08) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#​789](https://togithub.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://togithub.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab)) - Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#​781](https://togithub.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://togithub.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554)) - Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#​790](https://togithub.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://togithub.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92)) - Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#​773](https://togithub.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://togithub.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0)) - Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#​776](https://togithub.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://togithub.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#​780](https://togithub.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://togithub.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4)) - Update dependency io.grpc:grpc-bom to v1.48.1 ([#​768](https://togithub.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://togithub.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e)) - Update dependency io.grpc:grpc-bom to v1.49.0 ([#​786](https://togithub.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://togithub.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344)) - Update dependency org.checkerframework:checker-qual to v3.24.0 ([#​775](https://togithub.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://togithub.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b)) - Update dependency org.checkerframework:checker-qual to v3.25.0 ([#​788](https://togithub.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://togithub.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9)) - Update dependency org.threeten:threetenbp to v1.6.1 ([#​782](https://togithub.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://togithub.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9)) - Update gax.version to v2.19.0 ([#​785](https://togithub.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://togithub.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa)) - Update google.core.version to v2.8.10 ([#​787](https://togithub.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://togithub.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558)) - Update google.core.version to v2.8.7 ([#​774](https://togithub.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://togithub.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e)) - Update google.core.version to v2.8.8 ([#​777](https://togithub.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://togithub.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200)) - Update google.core.version to v2.8.9 ([#​784](https://togithub.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://togithub.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3537960d..46f3e249 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.1 + 3.0.2 pom import From 7f6f5cec2578b1803de0fc41224694ce1b2b4396 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 20:44:22 +0000 Subject: [PATCH 02/43] chore(main): release 2.3.3 (#886) :robot: I have created a release *beep* *boop* --- ## [2.3.3](https://github.com/googleapis/java-language/compare/v2.3.2...v2.3.3) (2022-09-08) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#885](https://github.com/googleapis/java-language/issues/885)) ([cd8a4d0](https://github.com/googleapis/java-language/commit/cd8a4d03904a15cd8994b73f179f5bff391c97fe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 9 files changed, 34 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12cceb86..394623f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.3.3](https://github.com/googleapis/java-language/compare/v2.3.2...v2.3.3) (2022-09-08) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#885](https://github.com/googleapis/java-language/issues/885)) ([cd8a4d0](https://github.com/googleapis/java-language/commit/cd8a4d03904a15cd8994b73f179f5bff391c97fe)) + ## [2.3.2](https://github.com/googleapis/java-language/compare/v2.3.1...v2.3.2) (2022-08-09) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index 1de2e862..a1acd9c8 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.3.3-SNAPSHOT + 2.3.3 pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.3.3-SNAPSHOT + 2.3.3 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.3-SNAPSHOT + 2.3.3 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.3-SNAPSHOT + 0.90.3 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.3-SNAPSHOT + 2.3.3 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.3-SNAPSHOT + 0.90.3 diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index b0c97aa1..0cb4cf9e 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.3.3-SNAPSHOT + 2.3.3 jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.3.3-SNAPSHOT + 2.3.3 google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index 10b2e69c..f622b479 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.3-SNAPSHOT + 2.3.3 grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index d5d257c8..f719a69b 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.3-SNAPSHOT + 0.90.3 grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/pom.xml b/pom.xml index 46f3e249..197b1090 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.3.3-SNAPSHOT + 2.3.3 Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.3.3-SNAPSHOT + 2.3.3 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.3-SNAPSHOT + 0.90.3 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.3-SNAPSHOT + 2.3.3 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.3-SNAPSHOT + 0.90.3 com.google.cloud google-cloud-language - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index ee4f7609..5bd65cf2 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.3-SNAPSHOT + 2.3.3 proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index e40d0af4..b20282c7 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.3-SNAPSHOT + 0.90.3 proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/versions.txt b/versions.txt index fa727853..887e360a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.3.2:2.3.3-SNAPSHOT -grpc-google-cloud-language-v1:2.3.2:2.3.3-SNAPSHOT -grpc-google-cloud-language-v1beta2:0.90.2:0.90.3-SNAPSHOT -proto-google-cloud-language-v1:2.3.2:2.3.3-SNAPSHOT -proto-google-cloud-language-v1beta2:0.90.2:0.90.3-SNAPSHOT +google-cloud-language:2.3.3:2.3.3 +grpc-google-cloud-language-v1:2.3.3:2.3.3 +grpc-google-cloud-language-v1beta2:0.90.3:0.90.3 +proto-google-cloud-language-v1:2.3.3:2.3.3 +proto-google-cloud-language-v1beta2:0.90.3:0.90.3 From 67e4ea19c3913492dae2d93f8c2d1f8764293a43 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 21:10:21 +0000 Subject: [PATCH 03/43] chore(main): release 2.3.4-SNAPSHOT (#887) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index a1acd9c8..47f7ae4f 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.3.3 + 2.3.4-SNAPSHOT pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.3.3 + 2.3.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.3 + 2.3.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.3 + 0.90.4-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1 - 2.3.3 + 2.3.4-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.3 + 0.90.4-SNAPSHOT diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 0cb4cf9e..2e0d629d 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.3.3 + 2.3.4-SNAPSHOT jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.3.3 + 2.3.4-SNAPSHOT google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index f622b479..fcedf2bd 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.3 + 2.3.4-SNAPSHOT grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index f719a69b..04877ca0 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.3 + 0.90.4-SNAPSHOT grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/pom.xml b/pom.xml index 197b1090..59dc98e9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.3.3 + 2.3.4-SNAPSHOT Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.3.3 + 2.3.4-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.3 + 0.90.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.3 + 2.3.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.3 + 0.90.4-SNAPSHOT com.google.cloud google-cloud-language - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index 5bd65cf2..5a9496a8 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.3 + 2.3.4-SNAPSHOT proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index b20282c7..c59ad13f 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.3 + 0.90.4-SNAPSHOT proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 887e360a..541f667e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.3.3:2.3.3 -grpc-google-cloud-language-v1:2.3.3:2.3.3 -grpc-google-cloud-language-v1beta2:0.90.3:0.90.3 -proto-google-cloud-language-v1:2.3.3:2.3.3 -proto-google-cloud-language-v1beta2:0.90.3:0.90.3 +google-cloud-language:2.3.3:2.3.4-SNAPSHOT +grpc-google-cloud-language-v1:2.3.3:2.3.4-SNAPSHOT +grpc-google-cloud-language-v1beta2:0.90.3:0.90.4-SNAPSHOT +proto-google-cloud-language-v1:2.3.3:2.3.4-SNAPSHOT +proto-google-cloud-language-v1beta2:0.90.3:0.90.4-SNAPSHOT From 8ebb344252b0f1dfda48ac0d14dd86ccf3d8b94d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 05:40:23 +0200 Subject: [PATCH 04/43] chore(deps): update dependency com.google.cloud:google-cloud-language to v2.3.3 (#888) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-language](https://togithub.com/googleapis/java-language) | `2.3.2` -> `2.3.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.3/compatibility-slim/2.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.3/confidence-slim/2.3.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-language ### [`v2.3.3`](https://togithub.com/googleapis/java-language/blob/HEAD/CHANGELOG.md#​233-httpsgithubcomgoogleapisjava-languagecomparev232v233-2022-09-08) [Compare Source](https://togithub.com/googleapis/java-language/compare/v2.3.2...v2.3.3) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#​885](https://togithub.com/googleapis/java-language/issues/885)) ([cd8a4d0](https://togithub.com/googleapis/java-language/commit/cd8a4d03904a15cd8994b73f179f5bff391c97fe))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f6a8ac38..eed70ac9 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-language - 2.3.2 + 2.3.3 ``` @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-language' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.3.2' +implementation 'com.google.cloud:google-cloud-language:2.3.3' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.2" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.3" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ad2c5a93..b04d2dce 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-language - 2.3.2 + 2.3.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index db48c087..7e94ca17 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-language - 2.3.2 + 2.3.3 From 32a11e182f0dea0afd882253da90715551c4fddf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 9 Sep 2022 15:32:21 +0000 Subject: [PATCH 05/43] chore(bazel): Update WORKSPACE files for rules_gapic, gax_java, generator_java versions (#884) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 472750037 Source-Link: https://github.com/googleapis/googleapis/commit/88f2ea3f53b9712f2e04f28f06210f6f77fa7e24 Source-Link: https://github.com/googleapis/googleapis-gen/commit/230a5588306aae18fe8f2a57f14d4039ad72c901 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjMwYTU1ODgzMDZhYWUxOGZlOGYyYTU3ZjE0ZDQwMzlhZDcyYzkwMSJ9 --- .../language/v1/LanguageServiceClient.java | 189 +++++++++++++----- .../language/v1/LanguageServiceSettings.java | 12 +- .../cloud/language/v1/package-info.java | 7 +- .../v1/stub/HttpJsonLanguageServiceStub.java | 18 +- .../v1/stub/LanguageServiceStubSettings.java | 12 +- .../v1beta2/LanguageServiceClient.java | 189 +++++++++++++----- .../v1beta2/LanguageServiceSettings.java | 12 +- .../cloud/language/v1beta2/package-info.java | 7 +- .../stub/HttpJsonLanguageServiceStub.java | 18 +- .../stub/LanguageServiceStubSettings.java | 12 +- .../analyzeentities/AsyncAnalyzeEntities.java | 7 +- .../analyzeentities/SyncAnalyzeEntities.java | 7 +- .../SyncAnalyzeEntitiesDocument.java | 7 +- ...ncAnalyzeEntitiesDocumentEncodingtype.java | 7 +- .../AsyncAnalyzeEntitySentiment.java | 7 +- .../SyncAnalyzeEntitySentiment.java | 7 +- .../SyncAnalyzeEntitySentimentDocument.java | 7 +- ...zeEntitySentimentDocumentEncodingtype.java | 7 +- .../AsyncAnalyzeSentiment.java | 7 +- .../SyncAnalyzeSentiment.java | 7 +- .../SyncAnalyzeSentimentDocument.java | 7 +- ...cAnalyzeSentimentDocumentEncodingtype.java | 7 +- .../analyzesyntax/AsyncAnalyzeSyntax.java | 7 +- .../analyzesyntax/SyncAnalyzeSyntax.java | 7 +- .../SyncAnalyzeSyntaxDocument.java | 7 +- ...SyncAnalyzeSyntaxDocumentEncodingtype.java | 7 +- .../annotatetext/AsyncAnnotateText.java | 7 +- .../annotatetext/SyncAnnotateText.java | 7 +- ...xtDocumentAnnotatetextrequestfeatures.java | 7 +- ...notatetextrequestfeaturesEncodingtype.java | 7 +- .../classifytext/AsyncClassifyText.java | 7 +- .../classifytext/SyncClassifyText.java | 7 +- .../SyncClassifyTextDocument.java | 7 +- .../SyncCreateSetCredentialsProvider.java | 7 +- .../SyncCreateSetCredentialsProvider1.java | 7 +- .../create/SyncCreateSetEndpoint.java | 7 +- .../SyncAnalyzeSentiment.java | 12 +- .../SyncAnalyzeSentiment.java | 12 +- .../analyzeentities/AsyncAnalyzeEntities.java | 7 +- .../analyzeentities/SyncAnalyzeEntities.java | 7 +- .../SyncAnalyzeEntitiesDocument.java | 7 +- ...ncAnalyzeEntitiesDocumentEncodingtype.java | 7 +- .../AsyncAnalyzeEntitySentiment.java | 7 +- .../SyncAnalyzeEntitySentiment.java | 7 +- .../SyncAnalyzeEntitySentimentDocument.java | 7 +- ...zeEntitySentimentDocumentEncodingtype.java | 7 +- .../AsyncAnalyzeSentiment.java | 7 +- .../SyncAnalyzeSentiment.java | 7 +- .../SyncAnalyzeSentimentDocument.java | 7 +- ...cAnalyzeSentimentDocumentEncodingtype.java | 7 +- .../analyzesyntax/AsyncAnalyzeSyntax.java | 7 +- .../analyzesyntax/SyncAnalyzeSyntax.java | 7 +- .../SyncAnalyzeSyntaxDocument.java | 7 +- ...SyncAnalyzeSyntaxDocumentEncodingtype.java | 7 +- .../annotatetext/AsyncAnnotateText.java | 7 +- .../annotatetext/SyncAnnotateText.java | 7 +- ...xtDocumentAnnotatetextrequestfeatures.java | 7 +- ...notatetextrequestfeaturesEncodingtype.java | 7 +- .../classifytext/AsyncClassifyText.java | 7 +- .../classifytext/SyncClassifyText.java | 7 +- .../SyncClassifyTextDocument.java | 7 +- .../SyncCreateSetCredentialsProvider.java | 7 +- .../SyncCreateSetCredentialsProvider1.java | 7 +- .../create/SyncCreateSetEndpoint.java | 7 +- .../SyncAnalyzeSentiment.java | 12 +- .../SyncAnalyzeSentiment.java | 12 +- 66 files changed, 612 insertions(+), 276 deletions(-) diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java index 02f76dc1..e4d00fdd 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java @@ -33,8 +33,11 @@ * calls that map to API methods. Sample code to get started: * *
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
  *   Document document = Document.newBuilder().build();
  *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
@@ -71,8 +74,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings languageServiceSettings =
  *     LanguageServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -84,8 +90,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings languageServiceSettings =
  *     LanguageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * LanguageServiceClient languageServiceClient =
@@ -96,8 +105,11 @@
  * the wire:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings languageServiceSettings =
  *     LanguageServiceSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -166,8 +178,11 @@ public LanguageServiceStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
@@ -190,8 +205,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -221,8 +239,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSentimentRequest request =
    *       AnalyzeSentimentRequest.newBuilder()
@@ -247,8 +268,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest r
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSentimentRequest request =
    *       AnalyzeSentimentRequest.newBuilder()
@@ -275,8 +299,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest r
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
@@ -300,8 +327,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -332,8 +362,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitiesRequest request =
    *       AnalyzeEntitiesRequest.newBuilder()
@@ -359,8 +392,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitiesRequest request =
    *       AnalyzeEntitiesRequest.newBuilder()
@@ -388,8 +424,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeEntitySentimentResponse response =
@@ -415,8 +454,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document docu
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -448,8 +490,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitySentimentRequest request =
    *       AnalyzeEntitySentimentRequest.newBuilder()
@@ -478,8 +523,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitySentimentRequest request =
    *       AnalyzeEntitySentimentRequest.newBuilder()
@@ -506,8 +554,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
@@ -530,8 +581,11 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -560,8 +614,11 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSyntaxRequest request =
    *       AnalyzeSyntaxRequest.newBuilder()
@@ -587,8 +644,11 @@ public final AnalyzeSyntaxResponse analyzeSyntax(AnalyzeSyntaxRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSyntaxRequest request =
    *       AnalyzeSyntaxRequest.newBuilder()
@@ -613,8 +673,11 @@ public final UnaryCallable analyzeS
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   ClassifyTextResponse response = languageServiceClient.classifyText(document);
@@ -636,8 +699,11 @@ public final ClassifyTextResponse classifyText(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   ClassifyTextRequest request =
    *       ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
@@ -659,8 +725,11 @@ public final ClassifyTextResponse classifyText(ClassifyTextRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   ClassifyTextRequest request =
    *       ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
@@ -683,8 +752,11 @@ public final UnaryCallable classifyTe
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
@@ -711,8 +783,11 @@ public final AnnotateTextResponse annotateText(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
@@ -746,8 +821,11 @@ public final AnnotateTextResponse annotateText(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnnotateTextRequest request =
    *       AnnotateTextRequest.newBuilder()
@@ -774,8 +852,11 @@ public final AnnotateTextResponse annotateText(AnnotateTextRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnnotateTextRequest request =
    *       AnnotateTextRequest.newBuilder()
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java
index 30e6a07e..ddb085e7 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java
@@ -50,17 +50,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings.Builder languageServiceSettingsBuilder =
  *     LanguageServiceSettings.newBuilder();
  * languageServiceSettingsBuilder
  *     .analyzeSentimentSettings()
  *     .setRetrySettings(
- *         languageServiceSettingsBuilder
- *             .analyzeSentimentSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java
index 6f13ad8e..5d1efcb4 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java
@@ -25,8 +25,11 @@
  * 

Sample for LanguageServiceClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
  *   Document document = Document.newBuilder().build();
  *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java
index a7472b01..7956fe99 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java
@@ -85,7 +85,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -119,7 +120,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -155,7 +157,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -189,7 +192,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -223,7 +227,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -257,7 +262,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java
index 8ac845b3..2b662592 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java
@@ -73,17 +73,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceStubSettings.Builder languageServiceSettingsBuilder =
  *     LanguageServiceStubSettings.newBuilder();
  * languageServiceSettingsBuilder
  *     .analyzeSentimentSettings()
  *     .setRetrySettings(
- *         languageServiceSettingsBuilder
- *             .analyzeSentimentSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java
index dd0d7a07..e887f23b 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java
@@ -34,8 +34,11 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
  *   Document document = Document.newBuilder().build();
  *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
@@ -72,8 +75,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings languageServiceSettings =
  *     LanguageServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -85,8 +91,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings languageServiceSettings =
  *     LanguageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * LanguageServiceClient languageServiceClient =
@@ -97,8 +106,11 @@
  * the wire:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings languageServiceSettings =
  *     LanguageServiceSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -168,8 +180,11 @@ public LanguageServiceStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
@@ -192,8 +207,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -224,8 +242,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSentimentRequest request =
    *       AnalyzeSentimentRequest.newBuilder()
@@ -250,8 +271,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest r
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSentimentRequest request =
    *       AnalyzeSentimentRequest.newBuilder()
@@ -278,8 +302,11 @@ public final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest r
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
@@ -303,8 +330,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -335,8 +365,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitiesRequest request =
    *       AnalyzeEntitiesRequest.newBuilder()
@@ -362,8 +395,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitiesRequest request =
    *       AnalyzeEntitiesRequest.newBuilder()
@@ -391,8 +427,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeEntitySentimentResponse response =
@@ -418,8 +457,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document docu
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -451,8 +493,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitySentimentRequest request =
    *       AnalyzeEntitySentimentRequest.newBuilder()
@@ -481,8 +526,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeEntitySentimentRequest request =
    *       AnalyzeEntitySentimentRequest.newBuilder()
@@ -509,8 +557,11 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
@@ -533,8 +584,11 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   EncodingType encodingType = EncodingType.forNumber(0);
@@ -563,8 +617,11 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSyntaxRequest request =
    *       AnalyzeSyntaxRequest.newBuilder()
@@ -590,8 +647,11 @@ public final AnalyzeSyntaxResponse analyzeSyntax(AnalyzeSyntaxRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnalyzeSyntaxRequest request =
    *       AnalyzeSyntaxRequest.newBuilder()
@@ -616,8 +676,11 @@ public final UnaryCallable analyzeS
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   ClassifyTextResponse response = languageServiceClient.classifyText(document);
@@ -639,8 +702,11 @@ public final ClassifyTextResponse classifyText(Document document) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   ClassifyTextRequest request =
    *       ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
@@ -662,8 +728,11 @@ public final ClassifyTextResponse classifyText(ClassifyTextRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   ClassifyTextRequest request =
    *       ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
@@ -686,8 +755,11 @@ public final UnaryCallable classifyTe
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
@@ -714,8 +786,11 @@ public final AnnotateTextResponse annotateText(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   Document document = Document.newBuilder().build();
    *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
@@ -749,8 +824,11 @@ public final AnnotateTextResponse annotateText(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnnotateTextRequest request =
    *       AnnotateTextRequest.newBuilder()
@@ -777,8 +855,11 @@ public final AnnotateTextResponse annotateText(AnnotateTextRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
    *   AnnotateTextRequest request =
    *       AnnotateTextRequest.newBuilder()
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java
index 1bef411b..5d2d0dbb 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java
@@ -50,17 +50,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceSettings.Builder languageServiceSettingsBuilder =
  *     LanguageServiceSettings.newBuilder();
  * languageServiceSettingsBuilder
  *     .analyzeSentimentSettings()
  *     .setRetrySettings(
- *         languageServiceSettingsBuilder
- *             .analyzeSentimentSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java
index 00cfffea..8d011841 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java
@@ -25,8 +25,11 @@
  * 

Sample for LanguageServiceClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
  *   Document document = Document.newBuilder().build();
  *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java
index 1630211e..f177a261 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java
@@ -85,7 +85,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -119,7 +120,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -156,7 +158,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -190,7 +193,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -224,7 +228,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -258,7 +263,8 @@ public class HttpJsonLanguageServiceStub extends LanguageServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("*", request.toBuilder().build()))
+                              ProtoRestSerializer.create()
+                                  .toBody("*", request.toBuilder().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java
index 721185c0..ea0e4565 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java
@@ -73,17 +73,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * LanguageServiceStubSettings.Builder languageServiceSettingsBuilder =
  *     LanguageServiceStubSettings.newBuilder();
  * languageServiceSettingsBuilder
  *     .analyzeSentimentSettings()
  *     .setRetrySettings(
- *         languageServiceSettingsBuilder
- *             .analyzeSentimentSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java
index c5dcde02..f35e1201 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeEntities() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitiesRequest request =
           AnalyzeEntitiesRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java
index 647da31d..1b641f00 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntities() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitiesRequest request =
           AnalyzeEntitiesRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java
index 6979956c..7c06cfc8 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitiesDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java
index c0c55004..c249d1b4 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitiesDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java
index 0b0c3d03..771ae366 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeEntitySentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitySentimentRequest request =
           AnalyzeEntitySentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java
index 81ea2d78..00e55c62 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitySentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitySentimentRequest request =
           AnalyzeEntitySentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java
index a5c73d8a..fc6505eb 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitySentimentDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeEntitySentimentResponse response =
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java
index f31ef23e..4bd8bbd3 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitySentimentDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java
index 0e5cd648..1224abdd 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSentimentRequest request =
           AnalyzeSentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java
index 8b19f3ee..fc5b5f9f 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSentimentRequest request =
           AnalyzeSentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java
index faaf05a0..5fc0ab6b 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentimentDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java
index 3b2c8764..9baa8e4f 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentimentDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java
index d5a7a3f5..ea72f04b 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeSyntax() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSyntaxRequest request =
           AnalyzeSyntaxRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java
index 52acf866..34e80427 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSyntax() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSyntaxRequest request =
           AnalyzeSyntaxRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java
index 8fdcce26..282e8557 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSyntaxDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java
index 3f461876..fdeab0b6 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSyntaxDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java
index e68d89cd..8bcc06e7 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnnotateText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnnotateTextRequest request =
           AnnotateTextRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java
index 197561c1..47245674 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnnotateText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnnotateTextRequest request =
           AnnotateTextRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java
index 8415a8f0..b78e84ad 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnnotateTextDocumentAnnotatetextrequestfeatures() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java
index 477c4b81..261a6b4d 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
 
   public static void syncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype()
       throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java
index f32f5513..def8f6a5 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncClassifyText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       ClassifyTextRequest request =
           ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java
index 71cc2b42..5e68d26b 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncClassifyText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       ClassifyTextRequest request =
           ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java
index dc264b7b..93665252 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncClassifyTextDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       ClassifyTextResponse response = languageServiceClient.classifyText(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java
index 5affb679..8e0ac427 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncCreateSetCredentialsProvider() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings languageServiceSettings =
         LanguageServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java
index 5557835f..3ad70bd4 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java
@@ -27,8 +27,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncCreateSetCredentialsProvider1() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings languageServiceSettings =
         LanguageServiceSettings.newBuilder()
             .setTransportChannelProvider(
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java
index e24ecbe8..bc6d0712 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncCreateSetEndpoint() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings languageServiceSettings =
         LanguageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     LanguageServiceClient languageServiceClient =
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java
index 00da3016..b1989ce7 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java
@@ -27,17 +27,17 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings.Builder languageServiceSettingsBuilder =
         LanguageServiceSettings.newBuilder();
     languageServiceSettingsBuilder
         .analyzeSentimentSettings()
         .setRetrySettings(
-            languageServiceSettingsBuilder
-                .analyzeSentimentSettings()
-                .getRetrySettings()
-                .toBuilder()
+            languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
                 .setTotalTimeout(Duration.ofSeconds(30))
                 .build());
     LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java
index bee72673..08acbeda 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java
@@ -27,17 +27,17 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceStubSettings.Builder languageServiceSettingsBuilder =
         LanguageServiceStubSettings.newBuilder();
     languageServiceSettingsBuilder
         .analyzeSentimentSettings()
         .setRetrySettings(
-            languageServiceSettingsBuilder
-                .analyzeSentimentSettings()
-                .getRetrySettings()
-                .toBuilder()
+            languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
                 .setTotalTimeout(Duration.ofSeconds(30))
                 .build());
     LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java
index 428a0a5a..1a1f9409 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeEntities() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitiesRequest request =
           AnalyzeEntitiesRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java
index a9f9c8e9..901012a5 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntities() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitiesRequest request =
           AnalyzeEntitiesRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java
index 51684990..f08af4b7 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitiesDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java
index 5683d97c..89bc7669 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitiesDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java
index fa5214d0..3b053866 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeEntitySentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitySentimentRequest request =
           AnalyzeEntitySentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java
index 0c934d0b..baf5711f 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitySentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeEntitySentimentRequest request =
           AnalyzeEntitySentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java
index d2aaf663..2df99ec2 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitySentimentDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeEntitySentimentResponse response =
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java
index 42c2975a..3bfbf272 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeEntitySentimentDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java
index 4ec820fc..aeb1e8ae 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSentimentRequest request =
           AnalyzeSentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java
index 19ee4b84..4c5f7e4e 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSentimentRequest request =
           AnalyzeSentimentRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java
index 6948b78e..bbc5d8c2 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentimentDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java
index c3047b32..cb710a70 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentimentDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java
index 5503e6f9..f5eee930 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnalyzeSyntax() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSyntaxRequest request =
           AnalyzeSyntaxRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java
index 688674a0..9254f4a5 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSyntax() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnalyzeSyntaxRequest request =
           AnalyzeSyntaxRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java
index a705cede..2332236d 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSyntaxDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java
index d420702b..ebc18f5a 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSyntaxDocumentEncodingtype() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       EncodingType encodingType = EncodingType.forNumber(0);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java
index ebf89288..3d38a4d9 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncAnnotateText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnnotateTextRequest request =
           AnnotateTextRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java
index 78134bec..078c2aec 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnnotateText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       AnnotateTextRequest request =
           AnnotateTextRequest.newBuilder()
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java
index 733b06cb..fdefd09b 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnnotateTextDocumentAnnotatetextrequestfeatures() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java
index 290af5fb..8087f31b 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java
@@ -31,8 +31,11 @@ public static void main(String[] args) throws Exception {
 
   public static void syncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype()
       throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java
index 273de85b..ab9f2a1f 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java
@@ -30,8 +30,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void asyncClassifyText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       ClassifyTextRequest request =
           ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java
index c6576356..11f02cd0 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncClassifyText() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       ClassifyTextRequest request =
           ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java
index 49d3ea34..94af5ca8 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncClassifyTextDocument() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
       Document document = Document.newBuilder().build();
       ClassifyTextResponse response = languageServiceClient.classifyText(document);
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java
index 93b53187..bddd0d4f 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java
@@ -29,8 +29,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncCreateSetCredentialsProvider() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings languageServiceSettings =
         LanguageServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java
index f156c764..5da25c5b 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java
@@ -27,8 +27,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncCreateSetCredentialsProvider1() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings languageServiceSettings =
         LanguageServiceSettings.newBuilder()
             .setTransportChannelProvider(
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java
index 39c2bd73..b8feb4d3 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java
@@ -28,8 +28,11 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncCreateSetEndpoint() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings languageServiceSettings =
         LanguageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     LanguageServiceClient languageServiceClient =
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java
index d5d64abf..95c191fe 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java
@@ -27,17 +27,17 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceSettings.Builder languageServiceSettingsBuilder =
         LanguageServiceSettings.newBuilder();
     languageServiceSettingsBuilder
         .analyzeSentimentSettings()
         .setRetrySettings(
-            languageServiceSettingsBuilder
-                .analyzeSentimentSettings()
-                .getRetrySettings()
-                .toBuilder()
+            languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
                 .setTotalTimeout(Duration.ofSeconds(30))
                 .build());
     LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build();
diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java
index 90bf72ce..bd35369f 100644
--- a/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java
+++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java
@@ -27,17 +27,17 @@ public static void main(String[] args) throws Exception {
   }
 
   public static void syncAnalyzeSentiment() throws Exception {
-    // This snippet has been automatically generated for illustrative purposes only.
-    // It may require modifications to work in your environment.
+    // This snippet has been automatically generated and should be regarded as a code template only.
+    // It will require modifications to work:
+    // - It may require correct/in-range values for request initialization.
+    // - It may require specifying regional endpoints when creating the service client as shown in
+    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     LanguageServiceStubSettings.Builder languageServiceSettingsBuilder =
         LanguageServiceStubSettings.newBuilder();
     languageServiceSettingsBuilder
         .analyzeSentimentSettings()
         .setRetrySettings(
-            languageServiceSettingsBuilder
-                .analyzeSentimentSettings()
-                .getRetrySettings()
-                .toBuilder()
+            languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
                 .setTotalTimeout(Duration.ofSeconds(30))
                 .build());
     LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build();

From 148b733ea0573cdb4c5fa1182ecb17058ae4e057 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Sat, 10 Sep 2022 02:08:14 +0000
Subject: [PATCH 06/43] chore: Generated snippets should not be owned by
 samples reviewers (#1575) (#889)

Source-Link: https://github.com/googleapis/synthtool/commit/2e9ac19d5b8181af77cdc5337cf922517813cc49
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
---
 .github/.OwlBot.lock.yaml | 3 +--
 .github/CODEOWNERS        | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index de9173d9..62592923 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,5 +13,4 @@
 # limitations under the License.
 docker:
   image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
-  digest: sha256:d4b80feffe1579818cdc39466152e9de95789a193408506cd4a1ffbe8804dc00
-# created: 2022-07-13T13:53:17.676447481Z
+  digest: sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 30fdb7b9..db2d8ad1 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -8,3 +8,6 @@
 
 # The java-samples-reviewers team is the default owner for samples changes
 samples/**/*.java       @googleapis/java-samples-reviewers
+
+# Generated snippets should not be owned by samples reviewers
+samples/snippets/generated/       @googleapis/yoshi-java

From 93599989f1b8ba59bf32c0542a1c537a3bac6a67 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate 
Date: Thu, 15 Sep 2022 14:14:21 +0200
Subject: [PATCH 07/43] deps: update dependency
 com.google.cloud:google-cloud-shared-dependencies to v3.0.3 (#890)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.2` -> `3.0.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/compatibility-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/confidence-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

googleapis/java-shared-dependencies ### [`v3.0.3`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​303-httpsgithubcomgoogleapisjava-shared-dependenciescomparev302v303-2022-09-14) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.2...v3.0.3) ##### Dependencies - Google-cloud-core 2.8.12 ([#​799](https://togithub.com/googleapis/java-shared-dependencies/issues/799)) ([1b3db8d](https://togithub.com/googleapis/java-shared-dependencies/commit/1b3db8d1e17c49ebae79fc96164fa9058e1df6e3)) - Moving gson to first-party-dependencies ([#​800](https://togithub.com/googleapis/java-shared-dependencies/issues/800)) ([a41fcc1](https://togithub.com/googleapis/java-shared-dependencies/commit/a41fcc11d32e02e5af2837561792e3919f6d4b3f)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.6 ([#​797](https://togithub.com/googleapis/java-shared-dependencies/issues/797)) ([bc5fdc9](https://togithub.com/googleapis/java-shared-dependencies/commit/bc5fdc9b3af7973c28f063a9ac156fe2af562814)) - Update gax.version to v2.19.1 ([#​798](https://togithub.com/googleapis/java-shared-dependencies/issues/798)) ([84e5487](https://togithub.com/googleapis/java-shared-dependencies/commit/84e5487b2e3dce4bb60badecebde788c3cb702b8)) - Update google.core.version to v2.8.11 ([#​793](https://togithub.com/googleapis/java-shared-dependencies/issues/793)) ([63c1297](https://togithub.com/googleapis/java-shared-dependencies/commit/63c129722aa0b821031ff5b4c11004adf7b12044))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59dc98e9..be5c8566 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.2 + 3.0.3 pom import From 5d54464673e4ee375e1aed69aaa20452f9baafe7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 12:30:15 +0000 Subject: [PATCH 08/43] chore(main): release 2.3.4 (#891) :robot: I have created a release *beep* *boop* --- ## [2.3.4](https://github.com/googleapis/java-language/compare/v2.3.3...v2.3.4) (2022-09-15) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#890](https://github.com/googleapis/java-language/issues/890)) ([9359998](https://github.com/googleapis/java-language/commit/93599989f1b8ba59bf32c0542a1c537a3bac6a67)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 9 files changed, 34 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 394623f3..f99a7690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.3.4](https://github.com/googleapis/java-language/compare/v2.3.3...v2.3.4) (2022-09-15) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#890](https://github.com/googleapis/java-language/issues/890)) ([9359998](https://github.com/googleapis/java-language/commit/93599989f1b8ba59bf32c0542a1c537a3bac6a67)) + ## [2.3.3](https://github.com/googleapis/java-language/compare/v2.3.2...v2.3.3) (2022-09-08) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index 47f7ae4f..765879ac 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.3.4-SNAPSHOT + 2.3.4 pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.3.4-SNAPSHOT + 2.3.4 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.4-SNAPSHOT + 2.3.4 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.4-SNAPSHOT + 0.90.4 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.4-SNAPSHOT + 2.3.4 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.4-SNAPSHOT + 0.90.4 diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 2e0d629d..13e3b32b 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.3.4-SNAPSHOT + 2.3.4 jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.3.4-SNAPSHOT + 2.3.4 google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index fcedf2bd..555a08b2 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.4-SNAPSHOT + 2.3.4 grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.4-SNAPSHOT + 2.3.4 diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index 04877ca0..9261d500 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.4-SNAPSHOT + 0.90.4 grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.4-SNAPSHOT + 2.3.4 diff --git a/pom.xml b/pom.xml index be5c8566..3bda1579 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.3.4-SNAPSHOT + 2.3.4 Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.3.4-SNAPSHOT + 2.3.4 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.4-SNAPSHOT + 0.90.4 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.4-SNAPSHOT + 2.3.4 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.4-SNAPSHOT + 0.90.4 com.google.cloud google-cloud-language - 2.3.4-SNAPSHOT + 2.3.4 diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index 5a9496a8..d6a336f6 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.4-SNAPSHOT + 2.3.4 proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.4-SNAPSHOT + 2.3.4 diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index c59ad13f..61f12968 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.4-SNAPSHOT + 0.90.4 proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.4-SNAPSHOT + 2.3.4 diff --git a/versions.txt b/versions.txt index 541f667e..7559c6cb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.3.3:2.3.4-SNAPSHOT -grpc-google-cloud-language-v1:2.3.3:2.3.4-SNAPSHOT -grpc-google-cloud-language-v1beta2:0.90.3:0.90.4-SNAPSHOT -proto-google-cloud-language-v1:2.3.3:2.3.4-SNAPSHOT -proto-google-cloud-language-v1beta2:0.90.3:0.90.4-SNAPSHOT +google-cloud-language:2.3.4:2.3.4 +grpc-google-cloud-language-v1:2.3.4:2.3.4 +grpc-google-cloud-language-v1beta2:0.90.4:0.90.4 +proto-google-cloud-language-v1:2.3.4:2.3.4 +proto-google-cloud-language-v1beta2:0.90.4:0.90.4 From 5dbfde0fab59563befc21f104972ab6673dfcfe4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 12:58:36 +0000 Subject: [PATCH 09/43] chore(main): release 2.3.5-SNAPSHOT (#892) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index 765879ac..b2bd2fcf 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.3.4 + 2.3.5-SNAPSHOT pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.3.4 + 2.3.5-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.4 + 2.3.5-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.4 + 0.90.5-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1 - 2.3.4 + 2.3.5-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.4 + 0.90.5-SNAPSHOT diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 13e3b32b..95d8208b 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.3.4 + 2.3.5-SNAPSHOT jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.3.4 + 2.3.5-SNAPSHOT google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index 555a08b2..c0152772 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.4 + 2.3.5-SNAPSHOT grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.4 + 2.3.5-SNAPSHOT diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index 9261d500..7e27702c 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.4 + 0.90.5-SNAPSHOT grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.4 + 2.3.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index 3bda1579..97838c31 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.3.4 + 2.3.5-SNAPSHOT Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.3.4 + 2.3.5-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.4 + 0.90.5-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.4 + 2.3.5-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.4 + 0.90.5-SNAPSHOT com.google.cloud google-cloud-language - 2.3.4 + 2.3.5-SNAPSHOT diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index d6a336f6..60e180cc 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.4 + 2.3.5-SNAPSHOT proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.4 + 2.3.5-SNAPSHOT diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index 61f12968..da25720b 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.4 + 0.90.5-SNAPSHOT proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.4 + 2.3.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index 7559c6cb..7e8deac3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.3.4:2.3.4 -grpc-google-cloud-language-v1:2.3.4:2.3.4 -grpc-google-cloud-language-v1beta2:0.90.4:0.90.4 -proto-google-cloud-language-v1:2.3.4:2.3.4 -proto-google-cloud-language-v1beta2:0.90.4:0.90.4 +google-cloud-language:2.3.4:2.3.5-SNAPSHOT +grpc-google-cloud-language-v1:2.3.4:2.3.5-SNAPSHOT +grpc-google-cloud-language-v1beta2:0.90.4:0.90.5-SNAPSHOT +proto-google-cloud-language-v1:2.3.4:2.3.5-SNAPSHOT +proto-google-cloud-language-v1beta2:0.90.4:0.90.5-SNAPSHOT From 265cc9acb603332a65daebd9d0d4d8bf29a3a98c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 16:34:28 +0200 Subject: [PATCH 10/43] chore(deps): update dependency com.google.cloud:google-cloud-language to v2.3.4 (#893) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-language](https://togithub.com/googleapis/java-language) | `2.3.3` -> `2.3.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.4/compatibility-slim/2.3.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.3.4/confidence-slim/2.3.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eed70ac9..96adba3e 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-language - 2.3.3 + 2.3.4 ``` @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-language' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.3.3' +implementation 'com.google.cloud:google-cloud-language:2.3.4' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.3" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.4" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b04d2dce..23aecd0c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-language - 2.3.3 + 2.3.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7e94ca17..a758fbb9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-language - 2.3.3 + 2.3.4 From 339890aef30ff67c42a02eb5951468fcfa0f2a1a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 17:28:15 +0200 Subject: [PATCH 11/43] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.2 (#894) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.1` -> `26.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/compatibility-slim/26.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/confidence-slim/26.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 4 ++-- samples/snippets/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96adba3e..96983a24 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.1.1 + 26.1.2 pom import @@ -49,7 +49,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.1') +implementation platform('com.google.cloud:libraries-bom:26.1.2') implementation 'com.google.cloud:google-cloud-language' ``` diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d0086e2c..2dc175bf 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 26.1.1 + 26.1.2 pom import From 41489691955887daa9e00a365be6012ce4a57943 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 14:20:33 +0000 Subject: [PATCH 12/43] feat: Add support for V1 and V2 classification models for the V1Beta2 API (#895) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 475604619 Source-Link: https://github.com/googleapis/googleapis/commit/044a15c14b1a1939684ad271c13ac84c5ac6a2c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/410020af934c7248f7804770d6f8ec4571bfa551 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDEwMDIwYWY5MzRjNzI0OGY3ODA0NzcwZDZmOGVjNDU3MWJmYTU1MSJ9 feat: Add support for V1 and V2 classification models for the V1 API PiperOrigin-RevId: 475599241 Source-Link: https://github.com/googleapis/googleapis/commit/05b99f982df9837c294ea3475a571a9252c68326 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3dcdbed8d968f634be0a2d3107237d232ee8b061 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2RjZGJlZDhkOTY4ZjYzNGJlMGEyZDMxMDcyMzdkMjMyZWU4YjA2MSJ9 --- .../language/v1/LanguageServiceClient.java | 36 +- .../cloud/language/v1/package-info.java | 4 +- .../v1beta2/LanguageServiceClient.java | 18 +- .../cloud/language/v1beta2/package-info.java | 4 +- .../language/v1/LanguageServiceGrpc.java | 24 +- .../language/v1beta2/LanguageServiceGrpc.java | 8 +- .../language/v1/AnalyzeEntitiesRequest.java | 24 +- .../v1/AnalyzeEntitiesRequestOrBuilder.java | 6 +- .../language/v1/AnalyzeEntitiesResponse.java | 21 +- .../v1/AnalyzeEntitiesResponseOrBuilder.java | 6 +- .../v1/AnalyzeEntitySentimentRequest.java | 24 +- ...nalyzeEntitySentimentRequestOrBuilder.java | 6 +- .../v1/AnalyzeEntitySentimentResponse.java | 21 +- ...alyzeEntitySentimentResponseOrBuilder.java | 6 +- .../language/v1/AnalyzeSentimentRequest.java | 24 +- .../v1/AnalyzeSentimentRequestOrBuilder.java | 6 +- .../language/v1/AnalyzeSentimentResponse.java | 21 +- .../v1/AnalyzeSentimentResponseOrBuilder.java | 6 +- .../language/v1/AnalyzeSyntaxRequest.java | 24 +- .../v1/AnalyzeSyntaxRequestOrBuilder.java | 6 +- .../language/v1/AnalyzeSyntaxResponse.java | 21 +- .../v1/AnalyzeSyntaxResponseOrBuilder.java | 6 +- .../language/v1/AnnotateTextRequest.java | 412 ++- .../v1/AnnotateTextRequestOrBuilder.java | 12 +- .../language/v1/AnnotateTextResponse.java | 21 +- .../v1/AnnotateTextResponseOrBuilder.java | 6 +- .../v1/ClassificationModelOptions.java | 2508 ++++++++++++++++ .../ClassificationModelOptionsOrBuilder.java | 106 + .../language/v1/ClassifyTextRequest.java | 336 ++- .../v1/ClassifyTextRequestOrBuilder.java | 48 +- .../google/cloud/language/v1/Document.java | 2 + .../com/google/cloud/language/v1/Entity.java | 182 +- .../cloud/language/v1/EntityMention.java | 72 +- .../language/v1/EntityMentionOrBuilder.java | 18 +- .../cloud/language/v1/EntityOrBuilder.java | 18 +- .../language/v1/LanguageServiceProto.java | 255 +- .../google/cloud/language/v1/Sentence.java | 48 +- .../cloud/language/v1/SentenceOrBuilder.java | 12 +- .../google/cloud/language/v1/TextSpan.java | 16 +- .../cloud/language/v1/TextSpanOrBuilder.java | 4 +- .../cloud/language/v1/language_service.proto | 233 +- .../language/v1beta2/AnnotateTextRequest.java | 378 ++- .../v1beta2/ClassificationModelOptions.java | 2540 +++++++++++++++++ .../ClassificationModelOptionsOrBuilder.java | 109 + .../language/v1beta2/ClassifyTextRequest.java | 328 +++ .../v1beta2/ClassifyTextRequestOrBuilder.java | 45 + .../cloud/language/v1beta2/Document.java | 534 ++++ .../language/v1beta2/DocumentOrBuilder.java | 58 + .../v1beta2/LanguageServiceProto.java | 515 ++-- .../language/v1beta2/language_service.proto | 130 +- .../classifytext/AsyncClassifyText.java | 6 +- .../classifytext/SyncClassifyText.java | 6 +- .../classifytext/AsyncClassifyText.java | 6 +- .../classifytext/SyncClassifyText.java | 6 +- 54 files changed, 8483 insertions(+), 809 deletions(-) create mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java create mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java create mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java create mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java index e4d00fdd..f5c952be 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java @@ -189,7 +189,7 @@ public LanguageServiceStub getStub() { * } * }
* - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeSentimentResponse analyzeSentiment(Document document) { @@ -218,7 +218,7 @@ public final AnalyzeSentimentResponse analyzeSentiment(Document document) { * } * }
* - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate sentence offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -310,7 +310,7 @@ public final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest r * } * }
* - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitiesResponse analyzeEntities(Document document) { @@ -340,7 +340,7 @@ public final AnalyzeEntitiesResponse analyzeEntities(Document document) { * } * }
* - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -436,7 +436,7 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ * } * }
* - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) { @@ -467,7 +467,7 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document docu * } * }
* - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -565,7 +565,7 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( * } * }
* - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { @@ -593,7 +593,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { * } * }
* - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -684,7 +684,7 @@ public final UnaryCallable analyzeS * } * }
* - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ClassifyTextResponse classifyText(Document document) { @@ -706,7 +706,10 @@ public final ClassifyTextResponse classifyText(Document document) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ClassifyTextResponse response = languageServiceClient.classifyText(request); * } * }
@@ -732,7 +735,10 @@ public final ClassifyTextResponse classifyText(ClassifyTextRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ApiFuture future = * languageServiceClient.classifyTextCallable().futureCall(request); * // Do something. @@ -764,8 +770,8 @@ public final UnaryCallable classifyTe * } * }
* - * @param document Input document. - * @param features The enabled features. + * @param document Required. Input document. + * @param features Required. The enabled features. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnnotateTextResponse annotateText( @@ -797,8 +803,8 @@ public final AnnotateTextResponse annotateText( * } * }
* - * @param document Input document. - * @param features The enabled features. + * @param document Required. Input document. + * @param features Required. The enabled features. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java index 5d1efcb4..a3260a78 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Natural Language API + * + *

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

======================= LanguageServiceClient ======================= * diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java index e887f23b..48573abc 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java @@ -552,7 +552,7 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part-of-speech tags, dependency trees, and other properties. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -579,7 +579,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part-of-speech tags, dependency trees, and other properties. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -612,7 +612,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part-of-speech tags, dependency trees, and other properties. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -642,7 +642,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(AnalyzeSyntaxRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part-of-speech tags, dependency trees, and other properties. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -709,7 +709,10 @@ public final ClassifyTextResponse classifyText(Document document) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ClassifyTextResponse response = languageServiceClient.classifyText(request); * } * }

@@ -735,7 +738,10 @@ public final ClassifyTextResponse classifyText(ClassifyTextRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ApiFuture future = * languageServiceClient.classifyTextCallable().futureCall(request); * // Do something. diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java index 8d011841..9575cab4 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Natural Language API + * + *

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

======================= LanguageServiceClient ======================= * diff --git a/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java b/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java index bf571966..e3f745e6 100644 --- a/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java +++ b/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java @@ -408,8 +408,10 @@ public void analyzeEntities( * * *

-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public void analyzeEntitySentiment( @@ -576,8 +578,10 @@ public void analyzeEntities( * * *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public void analyzeEntitySentiment( @@ -697,8 +701,10 @@ public com.google.cloud.language.v1.AnalyzeEntitiesResponse analyzeEntities( * * *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse analyzeEntitySentiment( @@ -804,8 +810,10 @@ protected LanguageServiceFutureStub build( * * *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< diff --git a/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java b/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java index b167f048..bfe3452d 100644 --- a/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java +++ b/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java @@ -426,7 +426,7 @@ public void analyzeEntitySentiment( * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ @@ -597,7 +597,7 @@ public void analyzeEntitySentiment( * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ @@ -714,7 +714,7 @@ public com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse analyzeE * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ @@ -823,7 +823,7 @@ protected LanguageServiceFutureStub build( * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java index a986dfc3..69dc1fbc 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -574,7 +574,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -590,7 +590,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -612,7 +612,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -636,7 +636,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -657,7 +657,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -685,7 +685,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -707,7 +707,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -723,7 +723,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -743,7 +743,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java index 1e4f6bc4..2b0136d7 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeEntitiesRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeEntitiesRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeEntitiesRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java index accd0b3e..23f750d8 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java @@ -206,7 +206,8 @@ public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int ind *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -231,7 +232,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -982,7 +984,8 @@ public java.util.List getEntitiesBu *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1006,7 +1009,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1030,7 +1034,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1053,7 +1058,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1072,7 +1078,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java index 62bb035b..4a920281 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java @@ -80,7 +80,8 @@ public interface AnalyzeEntitiesResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -94,7 +95,8 @@ public interface AnalyzeEntitiesResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java index f6b2118f..e2320968 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -575,7 +575,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -591,7 +591,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -613,7 +613,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -637,7 +637,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -658,7 +658,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -686,7 +686,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -708,7 +708,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -724,7 +724,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -744,7 +744,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java index f53159b9..9001f8b5 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeEntitySentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeEntitySentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeEntitySentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java index 905425e5..2307898c 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java @@ -207,7 +207,8 @@ public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int ind *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -232,7 +233,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -984,7 +986,8 @@ public java.util.List getEntitiesBu *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1008,7 +1011,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1032,7 +1036,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1055,7 +1060,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1074,7 +1080,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java index 16ee973a..885d156b 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java @@ -80,7 +80,8 @@ public interface AnalyzeEntitySentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -94,7 +95,8 @@ public interface AnalyzeEntitySentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java index 496ec1ee..78045d28 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -574,7 +574,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -590,7 +590,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -612,7 +612,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -636,7 +636,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -657,7 +657,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -685,7 +685,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -707,7 +707,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -723,7 +723,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -743,7 +743,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java index eb46a9fe..10852b5c 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeSentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeSentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeSentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java index 49f6247c..c5571518 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java @@ -201,7 +201,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -226,7 +227,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -913,7 +915,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -937,7 +940,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -961,7 +965,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -984,7 +989,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1003,7 +1009,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java index 9fa9e608..78f94d9b 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java @@ -64,7 +64,8 @@ public interface AnalyzeSentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -78,7 +79,8 @@ public interface AnalyzeSentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java index ca957684..a607c012 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -574,7 +574,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -590,7 +590,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -612,7 +612,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -636,7 +636,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -657,7 +657,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -685,7 +685,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -707,7 +707,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -723,7 +723,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -743,7 +743,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java index 410ea9f2..346123c3 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeSyntaxRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeSyntaxRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeSyntaxRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java index 0288ed59..214cca7e 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java @@ -290,7 +290,8 @@ public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; @@ -315,7 +316,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; @@ -1468,7 +1470,8 @@ public java.util.List getTokensBuild *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1492,7 +1495,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1516,7 +1520,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1539,7 +1544,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1558,7 +1564,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java index 1369f367..4a950561 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java @@ -132,7 +132,8 @@ public interface AnalyzeSyntaxResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; @@ -146,7 +147,8 @@ public interface AnalyzeSyntaxResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java index 40c2fa83..69eb77b8 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java @@ -216,6 +216,48 @@ public interface FeaturesOrBuilder * @return The classifyText. */ boolean getClassifyText(); + + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } /** * @@ -291,6 +333,23 @@ private Features( case 48: { classifyText_ = input.readBool(); + break; + } + case 82: + { + com.google.cloud.language.v1.ClassificationModelOptions.Builder subBuilder = null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -419,6 +478,61 @@ public boolean getClassifyText() { return classifyText_; } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 10; + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -448,6 +562,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classifyText_ != false) { output.writeBool(6, classifyText_); } + if (classificationModelOptions_ != null) { + output.writeMessage(10, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -472,6 +589,11 @@ public int getSerializedSize() { if (classifyText_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, classifyText_); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -493,6 +615,11 @@ public boolean equals(final java.lang.Object obj) { if (getExtractDocumentSentiment() != other.getExtractDocumentSentiment()) return false; if (getExtractEntitySentiment() != other.getExtractEntitySentiment()) return false; if (getClassifyText() != other.getClassifyText()) return false; + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -514,6 +641,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntitySentiment()); hash = (37 * hash) + CLASSIFY_TEXT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClassifyText()); + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -673,6 +804,12 @@ public Builder clear() { classifyText_ = false; + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -705,6 +842,11 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features buildPartial() result.extractDocumentSentiment_ = extractDocumentSentiment_; result.extractEntitySentiment_ = extractEntitySentiment_; result.classifyText_ = classifyText_; + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -772,6 +914,9 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest.Featur if (other.getClassifyText() != false) { setClassifyText(other.getClassifyText()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1062,6 +1207,225 @@ public Builder clearClassifyText() { return this; } + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1.ClassificationModelOptions + getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1120,7 +1484,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInsta * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -1137,7 +1501,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -1156,7 +1520,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -1174,7 +1538,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -1191,7 +1555,7 @@ public boolean hasFeatures() { * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -1210,7 +1574,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -1641,7 +2005,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1657,7 +2021,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1679,7 +2043,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1703,7 +2067,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1724,7 +2088,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1752,7 +2116,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1774,7 +2138,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1790,7 +2154,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1810,7 +2174,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1844,7 +2208,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1860,7 +2224,7 @@ public boolean hasFeatures() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1882,7 +2246,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1906,7 +2270,7 @@ public Builder setFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Feat * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1928,7 +2292,7 @@ public Builder setFeatures( * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1956,7 +2320,7 @@ public Builder mergeFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Fe * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1978,7 +2342,7 @@ public Builder clearFeatures() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1994,7 +2358,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder getFeat * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -2015,7 +2379,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder getFeat * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java index d998316e..db69924b 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -68,7 +68,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -82,7 +82,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -96,7 +96,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java index 56f2bb54..e7471838 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java @@ -483,7 +483,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; @@ -508,7 +509,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; @@ -2500,7 +2502,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2524,7 +2527,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2548,7 +2552,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2571,7 +2576,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2590,7 +2596,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java index 42ca1b94..922f5b1f 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java @@ -246,7 +246,8 @@ public interface AnnotateTextResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; @@ -260,7 +261,8 @@ public interface AnnotateTextResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java new file mode 100644 index 00000000..ef354d0b --- /dev/null +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java @@ -0,0 +1,2508 @@ +/* + * 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/language/v1/language_service.proto + +package com.google.cloud.language.v1; + +/** + * + * + *
+ * Model options available for classification requests.
+ * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions} + */ +public final class ClassificationModelOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions) + ClassificationModelOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationModelOptions.newBuilder() to construct. + private ClassificationModelOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClassificationModelOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClassificationModelOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClassificationModelOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder subBuilder = + null; + if (modelTypeCase_ == 1) { + subBuilder = + ((com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 1; + break; + } + case 18: + { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder subBuilder = + null; + if (modelTypeCase_ == 2) { + subBuilder = + ((com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.class, + com.google.cloud.language.v1.ClassificationModelOptions.Builder.class); + } + + public interface V1ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions.V1Model) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Options for the V1 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V1Model} + */ + public static final class V1Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions.V1Model) + V1ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V1Model.newBuilder() to construct. + private V1Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V1Model() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V1Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V1Model( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.language.v1.ClassificationModelOptions.V1Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1.ClassificationModelOptions.V1Model other = + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model + 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.language.v1.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model 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; + } + /** + * + * + *
+     * Options for the V1 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V1Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions.V1Model) + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1.ClassificationModelOptions.V1Model.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model build() { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model buildPartial() { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model result = + new com.google.cloud.language.v1.ClassificationModelOptions.V1Model(this); + 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.language.v1.ClassificationModelOptions.V1Model) { + return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions.V1Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model other) { + if (other + == com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance()) + return this; + 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.language.v1.ClassificationModelOptions.V1Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.language.v1.ClassificationModelOptions.V1Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions.V1Model) + private static final com.google.cloud.language.v1.ClassificationModelOptions.V1Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions.V1Model(); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V1Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V1Model(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.language.v1.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface V2ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions.V2Model) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + int getContentCategoriesVersionValue(); + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + getContentCategoriesVersion(); + } + /** + * + * + *
+   * Options for the V2 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V2Model} + */ + public static final class V2Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions.V2Model) + V2ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V2Model.newBuilder() to construct. + private V2Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V2Model() { + contentCategoriesVersion_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V2Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V2Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + contentCategoriesVersion_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder.class); + } + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion} + */ + public enum ContentCategoriesVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + CONTENT_CATEGORIES_VERSION_UNSPECIFIED(0), + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + V1(1), + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + V2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + public static final int CONTENT_CATEGORIES_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + public static final int V1_VALUE = 1; + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + public static final int V2_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCategoriesVersion 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 ContentCategoriesVersion forNumber(int value) { + switch (value) { + case 0: + return CONTENT_CATEGORIES_VERSION_UNSPECIFIED; + case 1: + return V1; + case 2: + return V2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContentCategoriesVersion findValueByNumber(int number) { + return ContentCategoriesVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ContentCategoriesVersion[] VALUES = values(); + + public static ContentCategoriesVersion valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContentCategoriesVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion) + } + + public static final int CONTENT_CATEGORIES_VERSION_FIELD_NUMBER = 1; + private int contentCategoriesVersion_; + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + result = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (contentCategoriesVersion_ + != com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, contentCategoriesVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCategoriesVersion_ + != com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); + } + 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.language.v1.ClassificationModelOptions.V2Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1.ClassificationModelOptions.V2Model other = + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) obj; + + if (contentCategoriesVersion_ != other.contentCategoriesVersion_) 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) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; + hash = (53 * hash) + contentCategoriesVersion_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model + 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.language.v1.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model 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; + } + /** + * + * + *
+     * Options for the V2 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V2Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions.V2Model) + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1.ClassificationModelOptions.V2Model.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(); + contentCategoriesVersion_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model build() { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model buildPartial() { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model result = + new com.google.cloud.language.v1.ClassificationModelOptions.V2Model(this); + result.contentCategoriesVersion_ = contentCategoriesVersion_; + 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.language.v1.ClassificationModelOptions.V2Model) { + return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions.V2Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model other) { + if (other + == com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance()) + return this; + if (other.contentCategoriesVersion_ != 0) { + setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); + } + 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.language.v1.ClassificationModelOptions.V2Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCategoriesVersion_ = 0; + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The enum numeric value on the wire for contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersionValue(int value) { + + contentCategoriesVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + result = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersion( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + value) { + if (value == null) { + throw new NullPointerException(); + } + + contentCategoriesVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearContentCategoriesVersion() { + + contentCategoriesVersion_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model) + private static final com.google.cloud.language.v1.ClassificationModelOptions.V2Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions.V2Model(); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V2Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V2Model(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.language.v1.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public enum ModelTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + V1_MODEL(1), + V2_MODEL(2), + MODELTYPE_NOT_SET(0); + private final int value; + + private ModelTypeCase(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 ModelTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ModelTypeCase forNumber(int value) { + switch (value) { + case 1: + return V1_MODEL; + case 2: + return V2_MODEL; + case 0: + return MODELTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public static final int V1_MODEL_FIELD_NUMBER = 1; + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + + public static final int V2_MODEL_FIELD_NUMBER = 2; + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + + 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 (modelTypeCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (modelTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); + } + 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.language.v1.ClassificationModelOptions)) { + return super.equals(obj); + } + com.google.cloud.language.v1.ClassificationModelOptions other = + (com.google.cloud.language.v1.ClassificationModelOptions) obj; + + if (!getModelTypeCase().equals(other.getModelTypeCase())) return false; + switch (modelTypeCase_) { + case 1: + if (!getV1Model().equals(other.getV1Model())) return false; + break; + case 2: + if (!getV2Model().equals(other.getV2Model())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (modelTypeCase_) { + case 1: + hash = (37 * hash) + V1_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV1Model().hashCode(); + break; + case 2: + hash = (37 * hash) + V2_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV2Model().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions 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; + } + /** + * + * + *
+   * Model options available for classification requests.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions) + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.class, + com.google.cloud.language.v1.ClassificationModelOptions.Builder.class); + } + + // Construct using com.google.cloud.language.v1.ClassificationModelOptions.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(); + modelTypeCase_ = 0; + modelType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstanceForType() { + return com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions build() { + com.google.cloud.language.v1.ClassificationModelOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions buildPartial() { + com.google.cloud.language.v1.ClassificationModelOptions result = + new com.google.cloud.language.v1.ClassificationModelOptions(this); + if (modelTypeCase_ == 1) { + if (v1ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v1ModelBuilder_.build(); + } + } + if (modelTypeCase_ == 2) { + if (v2ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v2ModelBuilder_.build(); + } + } + result.modelTypeCase_ = modelTypeCase_; + 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.language.v1.ClassificationModelOptions) { + return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.language.v1.ClassificationModelOptions other) { + if (other == com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance()) + return this; + switch (other.getModelTypeCase()) { + case V1_MODEL: + { + mergeV1Model(other.getV1Model()); + break; + } + case V2_MODEL: + { + mergeV2Model(other.getV2Model()); + break; + } + case MODELTYPE_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.language.v1.ClassificationModelOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1.ClassificationModelOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public Builder clearModelType() { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder> + v1ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } else { + if (modelTypeCase_ == 1) { + return v1ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v1ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder builderForValue) { + if (v1ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v1ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder mergeV1Model( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1 + && modelType_ + != com.google.cloud.language.v1.ClassificationModelOptions.V1Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.newBuilder( + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 1) { + v1ModelBuilder_.mergeFrom(value); + } else { + v1ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder clearV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + } + v1ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder + getV1ModelBuilder() { + return getV1ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if ((modelTypeCase_ == 1) && (v1ModelBuilder_ != null)) { + return v1ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder> + getV1ModelFieldBuilder() { + if (v1ModelBuilder_ == null) { + if (!(modelTypeCase_ == 1)) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + v1ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder>( + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 1; + onChanged(); + ; + return v1ModelBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder> + v2ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } else { + if (modelTypeCase_ == 2) { + return v2ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v2ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder builderForValue) { + if (v2ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v2ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder mergeV2Model( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2 + && modelType_ + != com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.newBuilder( + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 2) { + v2ModelBuilder_.mergeFrom(value); + } else { + v2ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder clearV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + } + v2ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder + getV2ModelBuilder() { + return getV2ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if ((modelTypeCase_ == 2) && (v2ModelBuilder_ != null)) { + return v2ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder> + getV2ModelFieldBuilder() { + if (v2ModelBuilder_ == null) { + if (!(modelTypeCase_ == 2)) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + v2ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder>( + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 2; + onChanged(); + ; + return v2ModelBuilder_; + } + + @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.language.v1.ClassificationModelOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions) + private static final com.google.cloud.language.v1.ClassificationModelOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions(); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassificationModelOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationModelOptions(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.language.v1.ClassificationModelOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java new file mode 100644 index 00000000..852a2579 --- /dev/null +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java @@ -0,0 +1,106 @@ +/* + * 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/language/v1/language_service.proto + +package com.google.cloud.language.v1; + +public interface ClassificationModelOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + boolean hasV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder getV1ModelOrBuilder(); + + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + boolean hasV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder getV2ModelOrBuilder(); + + public com.google.cloud.language.v1.ClassificationModelOptions.ModelTypeCase getModelTypeCase(); +} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java index fb71a005..6a861980 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java @@ -82,6 +82,23 @@ private ClassifyTextRequest( document_ = subBuilder.buildPartial(); } + break; + } + case 26: + { + com.google.cloud.language.v1.ClassificationModelOptions.Builder subBuilder = null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -126,7 +143,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -143,7 +160,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -162,7 +179,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -174,6 +191,61 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { return getDocument(); } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -191,6 +263,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (document_ != null) { output.writeMessage(1, getDocument()); } + if (classificationModelOptions_ != null) { + output.writeMessage(3, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -203,6 +278,11 @@ public int getSerializedSize() { if (document_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -223,6 +303,11 @@ public boolean equals(final java.lang.Object obj) { if (hasDocument()) { if (!getDocument().equals(other.getDocument())) return false; } + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -238,6 +323,10 @@ public int hashCode() { hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getDocument().hashCode(); } + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -389,6 +478,12 @@ public Builder clear() { document_ = null; documentBuilder_ = null; } + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -421,6 +516,11 @@ public com.google.cloud.language.v1.ClassifyTextRequest buildPartial() { } else { result.document_ = documentBuilder_.build(); } + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -474,6 +574,9 @@ public Builder mergeFrom(com.google.cloud.language.v1.ClassifyTextRequest other) if (other.hasDocument()) { mergeDocument(other.getDocument()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -513,7 +616,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -529,7 +632,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -551,7 +654,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -575,7 +678,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -596,7 +699,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -624,7 +727,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -646,7 +749,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -662,7 +765,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -682,7 +785,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -706,6 +809,215 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { return documentBuilder_; } + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java index 6d362243..087944f5 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface ClassifyTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface ClassifyTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface ClassifyTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -63,4 +63,46 @@ public interface ClassifyTextRequestOrBuilder * */ com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java index b2b98e09..76a2d96c 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java @@ -22,6 +22,7 @@ * * *
+ * ################################################################ #
  * Represents the input to API methods.
  * 
* @@ -797,6 +798,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
+   * ################################################################ #
    * Represents the input to API methods.
    * 
* diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java index bfb7090c..c6991d69 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java @@ -283,14 +283,15 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Phone number<br><br>
+     * Phone number
      * The metadata lists the phone number, formatted according to local
-     * convention, plus whichever additional elements appear in the text:<ul>
-     * <li><code>number</code> &ndash; the actual number, broken down into
-     * sections as per local convention</li> <li><code>national_prefix</code>
-     * &ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
-     * region or area code, if detected</li> <li><code>extension</code> &ndash;
-     * phone extension (to be dialed after connection), if detected</li></ul>
+     * convention, plus whichever additional elements appear in the text:
+     * * `number` - the actual number, broken down into sections as per local
+     * convention
+     * * `national_prefix` - country code, if detected
+     * * `area_code` - region or area code, if detected
+     * * `extension` - phone extension (to be dialed after connection), if
+     * detected
      * 
* * PHONE_NUMBER = 9; @@ -300,19 +301,19 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Address<br><br>
+     * Address
      * The metadata identifies the street number and locality plus whichever
-     * additional elements appear in the text:<ul>
-     * <li><code>street_number</code> &ndash; street number</li>
-     * <li><code>locality</code> &ndash; city or town</li>
-     * <li><code>street_name</code> &ndash; street/route name, if detected</li>
-     * <li><code>postal_code</code> &ndash; postal code, if detected</li>
-     * <li><code>country</code> &ndash; country, if detected</li>
-     * <li><code>broad_region</code> &ndash; administrative area, such as the
-     * state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
-     * administrative area, such as county, if detected</li>
-     * <li><code>sublocality</code> &ndash; used in Asian addresses to demark a
-     * district within a city, if detected</li></ul>
+     * additional elements appear in the text:
+     * * `street_number` - street number
+     * * `locality` - city or town
+     * * `street_name` - street/route name, if detected
+     * * `postal_code` - postal code, if detected
+     * * `country` - country, if detected<
+     * * `broad_region` - administrative area, such as the state, if detected
+     * * `narrow_region` - smaller administrative area, such as county, if
+     * detected
+     * * `sublocality` - used in Asian addresses to demark a district within a
+     * city, if detected
      * 
* * ADDRESS = 10; @@ -322,11 +323,11 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Date<br><br>
-     * The metadata identifies the components of the date:<ul>
-     * <li><code>year</code> &ndash; four digit year, if detected</li>
-     * <li><code>month</code> &ndash; two digit month number, if detected</li>
-     * <li><code>day</code> &ndash; two digit day number, if detected</li></ul>
+     * Date
+     * The metadata identifies the components of the date:
+     * * `year` - four digit year, if detected
+     * * `month` - two digit month number, if detected
+     * * `day` - two digit day number, if detected
      * 
* * DATE = 11; @@ -336,7 +337,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Number<br><br>
+     * Number
      * The metadata is the number itself.
      * 
* @@ -347,8 +348,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Price<br><br>
-     * The metadata identifies the <code>value</code> and <code>currency</code>.
+     * Price
+     * The metadata identifies the `value` and `currency`.
      * 
* * PRICE = 13; @@ -441,14 +442,15 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Phone number<br><br>
+     * Phone number
      * The metadata lists the phone number, formatted according to local
-     * convention, plus whichever additional elements appear in the text:<ul>
-     * <li><code>number</code> &ndash; the actual number, broken down into
-     * sections as per local convention</li> <li><code>national_prefix</code>
-     * &ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
-     * region or area code, if detected</li> <li><code>extension</code> &ndash;
-     * phone extension (to be dialed after connection), if detected</li></ul>
+     * convention, plus whichever additional elements appear in the text:
+     * * `number` - the actual number, broken down into sections as per local
+     * convention
+     * * `national_prefix` - country code, if detected
+     * * `area_code` - region or area code, if detected
+     * * `extension` - phone extension (to be dialed after connection), if
+     * detected
      * 
* * PHONE_NUMBER = 9; @@ -458,19 +460,19 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Address<br><br>
+     * Address
      * The metadata identifies the street number and locality plus whichever
-     * additional elements appear in the text:<ul>
-     * <li><code>street_number</code> &ndash; street number</li>
-     * <li><code>locality</code> &ndash; city or town</li>
-     * <li><code>street_name</code> &ndash; street/route name, if detected</li>
-     * <li><code>postal_code</code> &ndash; postal code, if detected</li>
-     * <li><code>country</code> &ndash; country, if detected</li>
-     * <li><code>broad_region</code> &ndash; administrative area, such as the
-     * state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
-     * administrative area, such as county, if detected</li>
-     * <li><code>sublocality</code> &ndash; used in Asian addresses to demark a
-     * district within a city, if detected</li></ul>
+     * additional elements appear in the text:
+     * * `street_number` - street number
+     * * `locality` - city or town
+     * * `street_name` - street/route name, if detected
+     * * `postal_code` - postal code, if detected
+     * * `country` - country, if detected<
+     * * `broad_region` - administrative area, such as the state, if detected
+     * * `narrow_region` - smaller administrative area, such as county, if
+     * detected
+     * * `sublocality` - used in Asian addresses to demark a district within a
+     * city, if detected
      * 
* * ADDRESS = 10; @@ -480,11 +482,11 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Date<br><br>
-     * The metadata identifies the components of the date:<ul>
-     * <li><code>year</code> &ndash; four digit year, if detected</li>
-     * <li><code>month</code> &ndash; two digit month number, if detected</li>
-     * <li><code>day</code> &ndash; two digit day number, if detected</li></ul>
+     * Date
+     * The metadata identifies the components of the date:
+     * * `year` - four digit year, if detected
+     * * `month` - two digit month number, if detected
+     * * `day` - two digit day number, if detected
      * 
* * DATE = 11; @@ -494,7 +496,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Number<br><br>
+     * Number
      * The metadata is the number itself.
      * 
* @@ -505,8 +507,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Price<br><br>
-     * The metadata identifies the <code>value</code> and <code>currency</code>.
+     * Price
+     * The metadata identifies the `value` and `currency`.
      * 
* * PRICE = 13; @@ -915,9 +917,9 @@ public com.google.cloud.language.v1.EntityMentionOrBuilder getMentionsOrBuilder( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -933,9 +935,9 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -953,9 +955,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2257,9 +2259,9 @@ public com.google.cloud.language.v1.EntityMention.Builder addMentionsBuilder(int * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2274,9 +2276,9 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2297,9 +2299,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2322,9 +2324,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2344,9 +2346,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2373,9 +2375,9 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2396,9 +2398,9 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2413,9 +2415,9 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2434,9 +2436,9 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java index e176c4ba..d0f1d55c 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java @@ -392,9 +392,9 @@ public com.google.cloud.language.v1.EntityMention.Type getType() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -410,9 +410,9 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -430,9 +430,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1097,9 +1097,9 @@ public Builder clearType() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1114,9 +1114,9 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1137,9 +1137,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1162,9 +1162,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1184,9 +1184,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1213,9 +1213,9 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1236,9 +1236,9 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1253,9 +1253,9 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1274,9 +1274,9 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java index b0c19f72..444002d5 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java @@ -88,9 +88,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -103,9 +103,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -118,9 +118,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java index 40475ed7..326115d0 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java @@ -226,9 +226,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -241,9 +241,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -256,9 +256,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java index 8d943785..17ab199a 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java @@ -71,6 +71,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_language_v1_ClassificationCategory_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_language_v1_ClassificationCategory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -250,95 +262,111 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\020\001\022\n\n\006COMMON\020\002\"1\n\010TextSpan\022\017\n\007content\030\001 " + "\001(\t\022\024\n\014begin_offset\030\002 \001(\005\":\n\026Classificat" + "ionCategory\022\014\n\004name\030\001 \001(\t\022\022\n\nconfidence\030" - + "\002 \001(\002\"\223\001\n\027AnalyzeSentimentRequest\0229\n\010doc" - + "ument\030\001 \001(\0132\".google.cloud.language.v1.D" - + "ocumentB\003\340A\002\022=\n\rencoding_type\030\002 \001(\0162&.go" - + "ogle.cloud.language.v1.EncodingType\"\244\001\n\030" - + "AnalyzeSentimentResponse\022?\n\022document_sen" - + "timent\030\001 \001(\0132#.google.cloud.language.v1." - + "Sentiment\022\020\n\010language\030\002 \001(\t\0225\n\tsentences" - + "\030\003 \003(\0132\".google.cloud.language.v1.Senten" - + "ce\"\231\001\n\035AnalyzeEntitySentimentRequest\0229\n\010" + + "\002 \001(\002\"\270\003\n\032ClassificationModelOptions\022P\n\010" + + "v1_model\030\001 \001(\0132<.google.cloud.language.v" + + "1.ClassificationModelOptions.V1ModelH\000\022P" + + "\n\010v2_model\030\002 \001(\0132<.google.cloud.language" + + ".v1.ClassificationModelOptions.V2ModelH\000" + + "\032\t\n\007V1Model\032\334\001\n\007V2Model\022y\n\032content_categ" + + "ories_version\030\001 \001(\0162U.google.cloud.langu" + + "age.v1.ClassificationModelOptions.V2Mode" + + "l.ContentCategoriesVersion\"V\n\030ContentCat" + + "egoriesVersion\022*\n&CONTENT_CATEGORIES_VER" + + "SION_UNSPECIFIED\020\000\022\006\n\002V1\020\001\022\006\n\002V2\020\002B\014\n\nmo" + + "del_type\"\223\001\n\027AnalyzeSentimentRequest\0229\n\010" + "document\030\001 \001(\0132\".google.cloud.language.v" + "1.DocumentB\003\340A\002\022=\n\rencoding_type\030\002 \001(\0162&" - + ".google.cloud.language.v1.EncodingType\"f" - + "\n\036AnalyzeEntitySentimentResponse\0222\n\010enti" - + "ties\030\001 \003(\0132 .google.cloud.language.v1.En" - + "tity\022\020\n\010language\030\002 \001(\t\"\222\001\n\026AnalyzeEntiti" - + "esRequest\0229\n\010document\030\001 \001(\0132\".google.clo" - + "ud.language.v1.DocumentB\003\340A\002\022=\n\rencoding" - + "_type\030\002 \001(\0162&.google.cloud.language.v1.E" - + "ncodingType\"_\n\027AnalyzeEntitiesResponse\0222" - + "\n\010entities\030\001 \003(\0132 .google.cloud.language" - + ".v1.Entity\022\020\n\010language\030\002 \001(\t\"\220\001\n\024Analyze" - + "SyntaxRequest\0229\n\010document\030\001 \001(\0132\".google" - + ".cloud.language.v1.DocumentB\003\340A\002\022=\n\renco" - + "ding_type\030\002 \001(\0162&.google.cloud.language." - + "v1.EncodingType\"\221\001\n\025AnalyzeSyntaxRespons" - + "e\0225\n\tsentences\030\001 \003(\0132\".google.cloud.lang" - + "uage.v1.Sentence\022/\n\006tokens\030\002 \003(\0132\037.googl" - + "e.cloud.language.v1.Token\022\020\n\010language\030\003 " - + "\001(\t\"P\n\023ClassifyTextRequest\0229\n\010document\030\001" - + " \001(\0132\".google.cloud.language.v1.Document" - + "B\003\340A\002\"\\\n\024ClassifyTextResponse\022D\n\ncategor" - + "ies\030\001 \003(\01320.google.cloud.language.v1.Cla" - + "ssificationCategory\"\372\002\n\023AnnotateTextRequ" - + "est\0229\n\010document\030\001 \001(\0132\".google.cloud.lan" - + "guage.v1.DocumentB\003\340A\002\022M\n\010features\030\002 \001(\013" - + "26.google.cloud.language.v1.AnnotateText" - + "Request.FeaturesB\003\340A\002\022=\n\rencoding_type\030\003" - + " \001(\0162&.google.cloud.language.v1.Encoding" - + "Type\032\231\001\n\010Features\022\026\n\016extract_syntax\030\001 \001(" - + "\010\022\030\n\020extract_entities\030\002 \001(\010\022\"\n\032extract_d" - + "ocument_sentiment\030\003 \001(\010\022 \n\030extract_entit" - + "y_sentiment\030\004 \001(\010\022\025\n\rclassify_text\030\006 \001(\010" - + "\"\313\002\n\024AnnotateTextResponse\0225\n\tsentences\030\001" - + " \003(\0132\".google.cloud.language.v1.Sentence" - + "\022/\n\006tokens\030\002 \003(\0132\037.google.cloud.language" - + ".v1.Token\0222\n\010entities\030\003 \003(\0132 .google.clo" - + "ud.language.v1.Entity\022?\n\022document_sentim" - + "ent\030\004 \001(\0132#.google.cloud.language.v1.Sen" - + "timent\022\020\n\010language\030\005 \001(\t\022D\n\ncategories\030\006" - + " \003(\01320.google.cloud.language.v1.Classifi" - + "cationCategory*8\n\014EncodingType\022\010\n\004NONE\020\000" - + "\022\010\n\004UTF8\020\001\022\t\n\005UTF16\020\002\022\t\n\005UTF32\020\0032\260\n\n\017Lan" - + "guageService\022\310\001\n\020AnalyzeSentiment\0221.goog" - + "le.cloud.language.v1.AnalyzeSentimentReq" - + "uest\0322.google.cloud.language.v1.AnalyzeS" - + "entimentResponse\"M\202\323\344\223\002#\"\036/v1/documents:" - + "analyzeSentiment:\001*\332A\026document,encoding_" - + "type\332A\010document\022\304\001\n\017AnalyzeEntities\0220.go" - + "ogle.cloud.language.v1.AnalyzeEntitiesRe" - + "quest\0321.google.cloud.language.v1.Analyze" - + "EntitiesResponse\"L\202\323\344\223\002\"\"\035/v1/documents:" - + "analyzeEntities:\001*\332A\026document,encoding_t" - + "ype\332A\010document\022\340\001\n\026AnalyzeEntitySentimen" - + "t\0227.google.cloud.language.v1.AnalyzeEnti" - + "tySentimentRequest\0328.google.cloud.langua" - + "ge.v1.AnalyzeEntitySentimentResponse\"S\202\323" - + "\344\223\002)\"$/v1/documents:analyzeEntitySentime" - + "nt:\001*\332A\026document,encoding_type\332A\010documen" - + "t\022\274\001\n\rAnalyzeSyntax\022..google.cloud.langu" - + "age.v1.AnalyzeSyntaxRequest\032/.google.clo" - + "ud.language.v1.AnalyzeSyntaxResponse\"J\202\323" - + "\344\223\002 \"\033/v1/documents:analyzeSyntax:\001*\332A\026d" - + "ocument,encoding_type\332A\010document\022\237\001\n\014Cla" - + "ssifyText\022-.google.cloud.language.v1.Cla" - + "ssifyTextRequest\032..google.cloud.language" - + ".v1.ClassifyTextResponse\"0\202\323\344\223\002\037\"\032/v1/do" - + "cuments:classifyText:\001*\332A\010document\022\312\001\n\014A" - + "nnotateText\022-.google.cloud.language.v1.A" - + "nnotateTextRequest\032..google.cloud.langua" - + "ge.v1.AnnotateTextResponse\"[\202\323\344\223\002\037\"\032/v1/" - + "documents:annotateText:\001*\332A\037document,fea" - + "tures,encoding_type\332A\021document,features\032" - + "z\312A\027language.googleapis.com\322A]https://ww" - + "w.googleapis.com/auth/cloud-language,htt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "ormBx\n\034com.google.cloud.language.v1B\024Lan" - + "guageServiceProtoP\001Z@google.golang.org/g" - + "enproto/googleapis/cloud/language/v1;lan" - + "guageb\006proto3" + + ".google.cloud.language.v1.EncodingType\"\244" + + "\001\n\030AnalyzeSentimentResponse\022?\n\022document_" + + "sentiment\030\001 \001(\0132#.google.cloud.language." + + "v1.Sentiment\022\020\n\010language\030\002 \001(\t\0225\n\tsenten" + + "ces\030\003 \003(\0132\".google.cloud.language.v1.Sen" + + "tence\"\231\001\n\035AnalyzeEntitySentimentRequest\022" + + "9\n\010document\030\001 \001(\0132\".google.cloud.languag" + + "e.v1.DocumentB\003\340A\002\022=\n\rencoding_type\030\002 \001(" + + "\0162&.google.cloud.language.v1.EncodingTyp" + + "e\"f\n\036AnalyzeEntitySentimentResponse\0222\n\010e" + + "ntities\030\001 \003(\0132 .google.cloud.language.v1" + + ".Entity\022\020\n\010language\030\002 \001(\t\"\222\001\n\026AnalyzeEnt" + + "itiesRequest\0229\n\010document\030\001 \001(\0132\".google." + + "cloud.language.v1.DocumentB\003\340A\002\022=\n\rencod" + + "ing_type\030\002 \001(\0162&.google.cloud.language.v" + + "1.EncodingType\"_\n\027AnalyzeEntitiesRespons" + + "e\0222\n\010entities\030\001 \003(\0132 .google.cloud.langu" + + "age.v1.Entity\022\020\n\010language\030\002 \001(\t\"\220\001\n\024Anal" + + "yzeSyntaxRequest\0229\n\010document\030\001 \001(\0132\".goo" + + "gle.cloud.language.v1.DocumentB\003\340A\002\022=\n\re" + + "ncoding_type\030\002 \001(\0162&.google.cloud.langua" + + "ge.v1.EncodingType\"\221\001\n\025AnalyzeSyntaxResp" + + "onse\0225\n\tsentences\030\001 \003(\0132\".google.cloud.l" + + "anguage.v1.Sentence\022/\n\006tokens\030\002 \003(\0132\037.go" + + "ogle.cloud.language.v1.Token\022\020\n\010language" + + "\030\003 \001(\t\"\254\001\n\023ClassifyTextRequest\0229\n\010docume" + + "nt\030\001 \001(\0132\".google.cloud.language.v1.Docu" + + "mentB\003\340A\002\022Z\n\034classification_model_option" + + "s\030\003 \001(\01324.google.cloud.language.v1.Class" + + "ificationModelOptions\"\\\n\024ClassifyTextRes" + + "ponse\022D\n\ncategories\030\001 \003(\01320.google.cloud" + + ".language.v1.ClassificationCategory\"\326\003\n\023" + + "AnnotateTextRequest\0229\n\010document\030\001 \001(\0132\"." + + "google.cloud.language.v1.DocumentB\003\340A\002\022M" + + "\n\010features\030\002 \001(\01326.google.cloud.language" + + ".v1.AnnotateTextRequest.FeaturesB\003\340A\002\022=\n" + + "\rencoding_type\030\003 \001(\0162&.google.cloud.lang" + + "uage.v1.EncodingType\032\365\001\n\010Features\022\026\n\016ext" + + "ract_syntax\030\001 \001(\010\022\030\n\020extract_entities\030\002 " + + "\001(\010\022\"\n\032extract_document_sentiment\030\003 \001(\010\022" + + " \n\030extract_entity_sentiment\030\004 \001(\010\022\025\n\rcla" + + "ssify_text\030\006 \001(\010\022Z\n\034classification_model" + + "_options\030\n \001(\01324.google.cloud.language.v" + + "1.ClassificationModelOptions\"\313\002\n\024Annotat" + + "eTextResponse\0225\n\tsentences\030\001 \003(\0132\".googl" + + "e.cloud.language.v1.Sentence\022/\n\006tokens\030\002" + + " \003(\0132\037.google.cloud.language.v1.Token\0222\n" + + "\010entities\030\003 \003(\0132 .google.cloud.language." + + "v1.Entity\022?\n\022document_sentiment\030\004 \001(\0132#." + + "google.cloud.language.v1.Sentiment\022\020\n\010la" + + "nguage\030\005 \001(\t\022D\n\ncategories\030\006 \003(\01320.googl" + + "e.cloud.language.v1.ClassificationCatego" + + "ry*8\n\014EncodingType\022\010\n\004NONE\020\000\022\010\n\004UTF8\020\001\022\t" + + "\n\005UTF16\020\002\022\t\n\005UTF32\020\0032\260\n\n\017LanguageService" + + "\022\310\001\n\020AnalyzeSentiment\0221.google.cloud.lan" + + "guage.v1.AnalyzeSentimentRequest\0322.googl" + + "e.cloud.language.v1.AnalyzeSentimentResp" + + "onse\"M\202\323\344\223\002#\"\036/v1/documents:analyzeSenti" + + "ment:\001*\332A\026document,encoding_type\332A\010docum" + + "ent\022\304\001\n\017AnalyzeEntities\0220.google.cloud.l" + + "anguage.v1.AnalyzeEntitiesRequest\0321.goog" + + "le.cloud.language.v1.AnalyzeEntitiesResp" + + "onse\"L\202\323\344\223\002\"\"\035/v1/documents:analyzeEntit" + + "ies:\001*\332A\026document,encoding_type\332A\010docume" + + "nt\022\340\001\n\026AnalyzeEntitySentiment\0227.google.c" + + "loud.language.v1.AnalyzeEntitySentimentR" + + "equest\0328.google.cloud.language.v1.Analyz" + + "eEntitySentimentResponse\"S\202\323\344\223\002)\"$/v1/do" + + "cuments:analyzeEntitySentiment:\001*\332A\026docu" + + "ment,encoding_type\332A\010document\022\274\001\n\rAnalyz" + + "eSyntax\022..google.cloud.language.v1.Analy" + + "zeSyntaxRequest\032/.google.cloud.language." + + "v1.AnalyzeSyntaxResponse\"J\202\323\344\223\002 \"\033/v1/do" + + "cuments:analyzeSyntax:\001*\332A\026document,enco" + + "ding_type\332A\010document\022\237\001\n\014ClassifyText\022-." + + "google.cloud.language.v1.ClassifyTextReq" + + "uest\032..google.cloud.language.v1.Classify" + + "TextResponse\"0\202\323\344\223\002\037\"\032/v1/documents:clas" + + "sifyText:\001*\332A\010document\022\312\001\n\014AnnotateText\022" + + "-.google.cloud.language.v1.AnnotateTextR" + + "equest\032..google.cloud.language.v1.Annota" + + "teTextResponse\"[\202\323\344\223\002\037\"\032/v1/documents:an" + + "notateText:\001*\332A\037document,features,encodi" + + "ng_type\332A\021document,features\032z\312A\027language" + + ".googleapis.com\322A]https://www.googleapis" + + ".com/auth/cloud-language,https://www.goo" + + "gleapis.com/auth/cloud-platformBx\n\034com.g" + + "oogle.cloud.language.v1B\024LanguageService" + + "ProtoP\001Z@google.golang.org/genproto/goog" + + "leapis/cloud/language/v1;languageb\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -447,8 +475,34 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "Confidence", }); - internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor = + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor, + new java.lang.String[] { + "V1Model", "V2Model", "ModelType", + }); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor = + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor = + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor, + new java.lang.String[] { + "ContentCategoriesVersion", + }); + internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor = + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor, @@ -456,7 +510,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor, @@ -464,7 +518,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DocumentSentiment", "Language", "Sentences", }); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor, @@ -472,7 +526,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor, @@ -480,7 +534,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor, @@ -488,7 +542,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor, @@ -496,7 +550,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor, @@ -504,7 +558,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor, @@ -512,15 +566,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Sentences", "Tokens", "Language", }); internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_language_v1_ClassifyTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor, new java.lang.String[] { - "Document", + "Document", "ClassificationModelOptions", }); internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_language_v1_ClassifyTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor, @@ -528,7 +582,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Categories", }); internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_language_v1_AnnotateTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor, @@ -548,9 +602,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExtractDocumentSentiment", "ExtractEntitySentiment", "ClassifyText", + "ClassificationModelOptions", }); internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_language_v1_AnnotateTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor, diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java index 461cdeb7..ff00a442 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java @@ -189,8 +189,8 @@ public com.google.cloud.language.v1.TextSpanOrBuilder getTextOrBuilder() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -206,8 +206,8 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -225,8 +225,8 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -782,8 +782,8 @@ public com.google.cloud.language.v1.TextSpanOrBuilder getTextOrBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -798,8 +798,8 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -820,8 +820,8 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -844,8 +844,8 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -865,8 +865,8 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -893,8 +893,8 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -915,8 +915,8 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -931,8 +931,8 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -951,8 +951,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java index beaf0160..bf5fefcb 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java @@ -63,8 +63,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -77,8 +77,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -91,8 +91,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java index 8f4dd269..78b8aa14 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java @@ -174,7 +174,9 @@ public com.google.protobuf.ByteString getContentBytes() { * *
    * The API calculates the beginning offset of the content in the original
-   * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+   * document according to the
+   * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+   * request.
    * 
* * int32 begin_offset = 2; @@ -627,7 +629,9 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+     * document according to the
+     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+     * request.
      * 
* * int32 begin_offset = 2; @@ -643,7 +647,9 @@ public int getBeginOffset() { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+     * document according to the
+     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+     * request.
      * 
* * int32 begin_offset = 2; @@ -662,7 +668,9 @@ public Builder setBeginOffset(int value) { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+     * document according to the
+     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+     * request.
      * 
* * int32 begin_offset = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java index 6f39dd71..789ce7a8 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java @@ -53,7 +53,9 @@ public interface TextSpanOrBuilder * *
    * The API calculates the beginning offset of the content in the original
-   * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+   * document according to the
+   * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+   * request.
    * 
* * int32 begin_offset = 2; diff --git a/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto b/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto index 304eab07..06c68a27 100644 --- a/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto +++ b/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -26,16 +25,17 @@ option java_multiple_files = true; option java_outer_classname = "LanguageServiceProto"; option java_package = "com.google.cloud.language.v1"; - // Provides text analysis operations such as sentiment analysis and entity // recognition. service LanguageService { option (google.api.default_host) = "language.googleapis.com"; option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-language," - "https://www.googleapis.com/auth/cloud-platform"; + "https://www.googleapis.com/auth/cloud-language," + "https://www.googleapis.com/auth/cloud-platform"; + // Analyzes the sentiment of the provided text. - rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) { + rpc AnalyzeSentiment(AnalyzeSentimentRequest) + returns (AnalyzeSentimentResponse) { option (google.api.http) = { post: "/v1/documents:analyzeSentiment" body: "*" @@ -47,7 +47,8 @@ service LanguageService { // Finds named entities (currently proper names and common nouns) in the text // along with entity types, salience, mentions for each entity, and // other properties. - rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) { + rpc AnalyzeEntities(AnalyzeEntitiesRequest) + returns (AnalyzeEntitiesResponse) { option (google.api.http) = { post: "/v1/documents:analyzeEntities" body: "*" @@ -56,9 +57,12 @@ service LanguageService { option (google.api.method_signature) = "document"; } - // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes - // sentiment associated with each entity and its mentions. - rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) { + // Finds entities, similar to + // [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] + // in the text and analyzes sentiment associated with each entity and its + // mentions. + rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) + returns (AnalyzeEntitySentimentResponse) { option (google.api.http) = { post: "/v1/documents:analyzeEntitySentiment" body: "*" @@ -100,7 +104,7 @@ service LanguageService { } } - +// ################################################################ # // // Represents the input to API methods. message Document { @@ -151,11 +155,37 @@ message Sentence { TextSpan text = 1; // For calls to [AnalyzeSentiment][] or if - // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to - // true, this field will contain the sentiment for the sentence. + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] + // is set to true, this field will contain the sentiment for the sentence. Sentiment sentiment = 2; } +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +enum EncodingType { + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + NONE = 0; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + UTF8 = 1; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and JavaScript are examples of + // languages that use this encoding natively. + UTF16 = 2; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + UTF32 = 3; +} + // Represents a phrase in the text that is a known entity, such as // a person, an organization, or location. The API associates information, such // as salience and mentions, with entities. @@ -189,44 +219,53 @@ message Entity { // Other types of entities OTHER = 7; - // Phone number

+ // Phone number + // // The metadata lists the phone number, formatted according to local - // convention, plus whichever additional elements appear in the text:
    - //
  • number – the actual number, broken down into - // sections as per local convention
  • national_prefix - // – country code, if detected
  • area_code – - // region or area code, if detected
  • extension – - // phone extension (to be dialed after connection), if detected
+ // convention, plus whichever additional elements appear in the text: + // + // * `number` - the actual number, broken down into sections as per local + // convention + // * `national_prefix` - country code, if detected + // * `area_code` - region or area code, if detected + // * `extension` - phone extension (to be dialed after connection), if + // detected PHONE_NUMBER = 9; - // Address

+ // Address + // // The metadata identifies the street number and locality plus whichever - // additional elements appear in the text:
    - //
  • street_number – street number
  • - //
  • locality – city or town
  • - //
  • street_name – street/route name, if detected
  • - //
  • postal_code – postal code, if detected
  • - //
  • country – country, if detected
  • - //
  • broad_region – administrative area, such as the - // state, if detected
  • narrow_region – smaller - // administrative area, such as county, if detected
  • - //
  • sublocality – used in Asian addresses to demark a - // district within a city, if detected
+ // additional elements appear in the text: + // + // * `street_number` - street number + // * `locality` - city or town + // * `street_name` - street/route name, if detected + // * `postal_code` - postal code, if detected + // * `country` - country, if detected< + // * `broad_region` - administrative area, such as the state, if detected + // * `narrow_region` - smaller administrative area, such as county, if + // detected + // * `sublocality` - used in Asian addresses to demark a district within a + // city, if detected ADDRESS = 10; - // Date

- // The metadata identifies the components of the date:
    - //
  • year – four digit year, if detected
  • - //
  • month – two digit month number, if detected
  • - //
  • day – two digit day number, if detected
+ // Date + // + // The metadata identifies the components of the date: + // + // * `year` - four digit year, if detected + // * `month` - two digit month number, if detected + // * `day` - two digit day number, if detected DATE = 11; - // Number

+ // Number + // // The metadata is the number itself. NUMBER = 12; - // Price

- // The metadata identifies the value and currency. + // Price + // + // The metadata identifies the `value` and `currency`. PRICE = 13; } @@ -256,38 +295,12 @@ message Entity { repeated EntityMention mentions = 5; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to - // true, this field will contain the aggregate sentiment expressed for this - // entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] + // is set to true, this field will contain the aggregate sentiment expressed + // for this entity in the provided document. Sentiment sentiment = 6; } -// Represents the text encoding that the caller uses to process the output. -// Providing an `EncodingType` is recommended because the API provides the -// beginning offsets for various outputs, such as tokens and mentions, and -// languages that natively use different text encodings may access offsets -// differently. -enum EncodingType { - // If `EncodingType` is not specified, encoding-dependent information (such as - // `begin_offset`) will be set at `-1`. - NONE = 0; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-8 encoding of the input. C++ and Go are examples of languages - // that use this encoding natively. - UTF8 = 1; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-16 encoding of the input. Java and JavaScript are examples of - // languages that use this encoding natively. - UTF16 = 2; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-32 encoding of the input. Python is an example of a language - // that uses this encoding natively. - UTF32 = 3; -} - // Represents the smallest syntactic building block of the text. message Token { // The token text. @@ -935,9 +948,9 @@ message EntityMention { Type type = 2; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to - // true, this field will contain the sentiment expressed for this mention of - // the entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] + // is set to true, this field will contain the sentiment expressed for this + // mention of the entity in the provided document. Sentiment sentiment = 3; } @@ -947,7 +960,9 @@ message TextSpan { string content = 1; // The API calculates the beginning offset of the content in the original - // document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request. + // document according to the + // [EncodingType][google.cloud.language.v1.EncodingType] specified in the API + // request. int32 begin_offset = 2; } @@ -962,9 +977,46 @@ message ClassificationCategory { float confidence = 2; } +// Model options available for classification requests. +message ClassificationModelOptions { + // Options for the V1 model. + message V1Model {} + + // Options for the V2 model. + message V2Model { + // The content categories used for classification. + enum ContentCategoriesVersion { + // If `ContentCategoriesVersion` is not specified, this option will + // default to `V1`. + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + + // Legacy content categories of our initial launch in 2017. + V1 = 1; + + // Updated content categories in 2022. + V2 = 2; + } + + // The content categories used for classification. + ContentCategoriesVersion content_categories_version = 1; + } + + // If this field is not set, then the `v1_model` will be used by default. + oneof model_type { + // Setting this field will use the V1 model and V1 content categories + // version. The V1 model is a legacy model; support for this will be + // discontinued in the future. + V1Model v1_model = 1; + + // Setting this field will use the V2 model with the appropriate content + // categories version. The V2 model is a better performing model. + V2Model v2_model = 2; + } +} + // The sentiment analysis request message. message AnalyzeSentimentRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate sentence offsets. @@ -978,7 +1030,8 @@ message AnalyzeSentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 2; // The sentiment for all the sentences in the document. @@ -987,7 +1040,7 @@ message AnalyzeSentimentResponse { // The entity-level sentiment analysis request message. message AnalyzeEntitySentimentRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1001,13 +1054,14 @@ message AnalyzeEntitySentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 2; } // The entity analysis request message. message AnalyzeEntitiesRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1021,13 +1075,14 @@ message AnalyzeEntitiesResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 2; } // The syntax analysis request message. message AnalyzeSyntaxRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1044,14 +1099,19 @@ message AnalyzeSyntaxResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 3; } // The document classification request message. message ClassifyTextRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Model options to use for classification. Defaults to v1 options if not + // specified. + ClassificationModelOptions classification_model_options = 3; } // The document classification response message. @@ -1080,12 +1140,16 @@ message AnnotateTextRequest { // Classify the full document into categories. bool classify_text = 6; + + // The model options to use for classification. Defaults to v1 options + // if not specified. Only used if `classify_text` is set to true. + ClassificationModelOptions classification_model_options = 10; } - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; - // The enabled features. + // Required. The enabled features. Features features = 2 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1114,7 +1178,8 @@ message AnnotateTextResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 5; // Categories identified in the input document. diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java index 2cb17b94..2da5e0d9 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java @@ -220,6 +220,51 @@ public interface FeaturesOrBuilder * @return The classifyText. */ boolean getClassifyText(); + + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } /** * @@ -227,7 +272,7 @@ public interface FeaturesOrBuilder *
    * All available features for sentiment, syntax, and semantic analysis.
    * Setting each one to true will enable that specific analysis for the input.
-   * Next ID: 10
+   * Next ID: 11
    * 
* * Protobuf type {@code google.cloud.language.v1beta2.AnnotateTextRequest.Features} @@ -296,6 +341,24 @@ private Features( case 48: { classifyText_ = input.readBool(); + break; + } + case 82: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder subBuilder = + null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -427,6 +490,66 @@ public boolean getClassifyText() { return classifyText_; } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 10; + private com.google.cloud.language.v1beta2.ClassificationModelOptions + classificationModelOptions_; + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -456,6 +579,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classifyText_ != false) { output.writeBool(6, classifyText_); } + if (classificationModelOptions_ != null) { + output.writeMessage(10, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -480,6 +606,11 @@ public int getSerializedSize() { if (classifyText_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, classifyText_); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -501,6 +632,11 @@ public boolean equals(final java.lang.Object obj) { if (getExtractDocumentSentiment() != other.getExtractDocumentSentiment()) return false; if (getExtractEntitySentiment() != other.getExtractEntitySentiment()) return false; if (getClassifyText() != other.getClassifyText()) return false; + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -522,6 +658,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntitySentiment()); hash = (37 * hash) + CLASSIFY_TEXT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClassifyText()); + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -630,7 +770,7 @@ protected Builder newBuilderForType( *
      * All available features for sentiment, syntax, and semantic analysis.
      * Setting each one to true will enable that specific analysis for the input.
-     * Next ID: 10
+     * Next ID: 11
      * 
* * Protobuf type {@code google.cloud.language.v1beta2.AnnotateTextRequest.Features} @@ -682,6 +822,12 @@ public Builder clear() { classifyText_ = false; + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -715,6 +861,11 @@ public com.google.cloud.language.v1beta2.AnnotateTextRequest.Features buildParti result.extractDocumentSentiment_ = extractDocumentSentiment_; result.extractEntitySentiment_ = extractEntitySentiment_; result.classifyText_ = classifyText_; + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -784,6 +935,9 @@ public Builder mergeFrom( if (other.getClassifyText() != false) { setClassifyText(other.getClassifyText()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1084,6 +1238,226 @@ public Builder clearClassifyText() { return this; } + private com.google.cloud.language.v1beta2.ClassificationModelOptions + classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java new file mode 100644 index 00000000..739ab382 --- /dev/null +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java @@ -0,0 +1,2540 @@ +/* + * 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/language/v1beta2/language_service.proto + +package com.google.cloud.language.v1beta2; + +/** + * + * + *
+ * Model options available for classification requests.
+ * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions} + */ +public final class ClassificationModelOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1beta2.ClassificationModelOptions) + ClassificationModelOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationModelOptions.newBuilder() to construct. + private ClassificationModelOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClassificationModelOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClassificationModelOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClassificationModelOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder + subBuilder = null; + if (modelTypeCase_ == 1) { + subBuilder = + ((com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 1; + break; + } + case 18: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder + subBuilder = null; + if (modelTypeCase_ == 2) { + subBuilder = + ((com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder.class); + } + + public interface V1ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Options for the V1 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} + */ + public static final class V1Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + V1ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V1Model.newBuilder() to construct. + private V1Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V1Model() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V1Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V1Model( + 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; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.language.v1beta2.ClassificationModelOptions.V1Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model other = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model 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.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model 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.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model 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.language.v1beta2.ClassificationModelOptions.V1Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + 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.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model 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.language.v1beta2.ClassificationModelOptions.V1Model 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; + } + /** + * + * + *
+     * Options for the V1 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model build() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model buildPartial() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model result = + new com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(this); + 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.language.v1beta2.ClassificationModelOptions.V1Model) { + return mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model other) { + if (other + == com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance()) return this; + 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.language.v1beta2.ClassificationModelOptions.V1Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.language.v1beta2.ClassificationModelOptions.V1Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + private static final com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V1Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V1Model(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.language.v1beta2.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface V2ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + int getContentCategoriesVersionValue(); + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion + getContentCategoriesVersion(); + } + /** + * + * + *
+   * Options for the V2 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} + */ + public static final class V2Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + V2ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V2Model.newBuilder() to construct. + private V2Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V2Model() { + contentCategoriesVersion_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V2Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V2Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + contentCategoriesVersion_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder.class); + } + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion} + */ + public enum ContentCategoriesVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + CONTENT_CATEGORIES_VERSION_UNSPECIFIED(0), + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + V1(1), + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + V2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + public static final int CONTENT_CATEGORIES_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + public static final int V1_VALUE = 1; + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + public static final int V2_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCategoriesVersion 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 ContentCategoriesVersion forNumber(int value) { + switch (value) { + case 0: + return CONTENT_CATEGORIES_VERSION_UNSPECIFIED; + case 1: + return V1; + case 2: + return V2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContentCategoriesVersion findValueByNumber(int number) { + return ContentCategoriesVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ContentCategoriesVersion[] VALUES = values(); + + public static ContentCategoriesVersion valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContentCategoriesVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion) + } + + public static final int CONTENT_CATEGORIES_VERSION_FIELD_NUMBER = 1; + private int contentCategoriesVersion_; + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion + result = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (contentCategoriesVersion_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, contentCategoriesVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCategoriesVersion_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); + } + 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.language.v1beta2.ClassificationModelOptions.V2Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model other = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) obj; + + if (contentCategoriesVersion_ != other.contentCategoriesVersion_) 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) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; + hash = (53 * hash) + contentCategoriesVersion_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model 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.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model 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.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model 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.language.v1beta2.ClassificationModelOptions.V2Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + 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.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model 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.language.v1beta2.ClassificationModelOptions.V2Model 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; + } + /** + * + * + *
+     * Options for the V2 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.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(); + contentCategoriesVersion_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model build() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model buildPartial() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model result = + new com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(this); + result.contentCategoriesVersion_ = contentCategoriesVersion_; + 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.language.v1beta2.ClassificationModelOptions.V2Model) { + return mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model other) { + if (other + == com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance()) return this; + if (other.contentCategoriesVersion_ != 0) { + setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); + } + 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.language.v1beta2.ClassificationModelOptions.V2Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCategoriesVersion_ = 0; + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The enum numeric value on the wire for contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersionValue(int value) { + + contentCategoriesVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + result = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersion( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + value) { + if (value == null) { + throw new NullPointerException(); + } + + contentCategoriesVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearContentCategoriesVersion() { + + contentCategoriesVersion_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + private static final com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V2Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V2Model(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.language.v1beta2.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public enum ModelTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + V1_MODEL(1), + V2_MODEL(2), + MODELTYPE_NOT_SET(0); + private final int value; + + private ModelTypeCase(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 ModelTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ModelTypeCase forNumber(int value) { + switch (value) { + case 1: + return V1_MODEL; + case 2: + return V2_MODEL; + case 0: + return MODELTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public static final int V1_MODEL_FIELD_NUMBER = 1; + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model getV1Model() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + + public static final int V2_MODEL_FIELD_NUMBER = 2; + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model getV2Model() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + + 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 (modelTypeCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (modelTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_); + } + 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.language.v1beta2.ClassificationModelOptions)) { + return super.equals(obj); + } + com.google.cloud.language.v1beta2.ClassificationModelOptions other = + (com.google.cloud.language.v1beta2.ClassificationModelOptions) obj; + + if (!getModelTypeCase().equals(other.getModelTypeCase())) return false; + switch (modelTypeCase_) { + case 1: + if (!getV1Model().equals(other.getV1Model())) return false; + break; + case 2: + if (!getV2Model().equals(other.getV2Model())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (modelTypeCase_) { + case 1: + hash = (37 * hash) + V1_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV1Model().hashCode(); + break; + case 2: + hash = (37 * hash) + V2_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV2Model().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions 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.language.v1beta2.ClassificationModelOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions 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.language.v1beta2.ClassificationModelOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions 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.language.v1beta2.ClassificationModelOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions 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.language.v1beta2.ClassificationModelOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions 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.language.v1beta2.ClassificationModelOptions 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; + } + /** + * + * + *
+   * Model options available for classification requests.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1beta2.ClassificationModelOptions) + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder.class); + } + + // Construct using com.google.cloud.language.v1beta2.ClassificationModelOptions.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(); + modelTypeCase_ = 0; + modelType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getDefaultInstanceForType() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions build() { + com.google.cloud.language.v1beta2.ClassificationModelOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions buildPartial() { + com.google.cloud.language.v1beta2.ClassificationModelOptions result = + new com.google.cloud.language.v1beta2.ClassificationModelOptions(this); + if (modelTypeCase_ == 1) { + if (v1ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v1ModelBuilder_.build(); + } + } + if (modelTypeCase_ == 2) { + if (v2ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v2ModelBuilder_.build(); + } + } + result.modelTypeCase_ = modelTypeCase_; + 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.language.v1beta2.ClassificationModelOptions) { + return mergeFrom((com.google.cloud.language.v1beta2.ClassificationModelOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassificationModelOptions other) { + if (other + == com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance()) + return this; + switch (other.getModelTypeCase()) { + case V1_MODEL: + { + mergeV1Model(other.getV1Model()); + break; + } + case V2_MODEL: + { + mergeV2Model(other.getV2Model()); + break; + } + case MODELTYPE_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.language.v1beta2.ClassificationModelOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1beta2.ClassificationModelOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public Builder clearModelType() { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder> + v1ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model getV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } else { + if (modelTypeCase_ == 1) { + return v1ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v1ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder + builderForValue) { + if (v1ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v1ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder mergeV1Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1 + && modelType_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.newBuilder( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 1) { + v1ModelBuilder_.mergeFrom(value); + } else { + v1ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder clearV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + } + v1ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder + getV1ModelBuilder() { + return getV1ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if ((modelTypeCase_ == 1) && (v1ModelBuilder_ != null)) { + return v1ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder> + getV1ModelFieldBuilder() { + if (v1ModelBuilder_ == null) { + if (!(modelTypeCase_ == 1)) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + v1ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder>( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 1; + onChanged(); + ; + return v1ModelBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder> + v2ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model getV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } else { + if (modelTypeCase_ == 2) { + return v2ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v2ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder + builderForValue) { + if (v2ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v2ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder mergeV2Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2 + && modelType_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.newBuilder( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 2) { + v2ModelBuilder_.mergeFrom(value); + } else { + v2ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder clearV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + } + v2ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder + getV2ModelBuilder() { + return getV2ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if ((modelTypeCase_ == 2) && (v2ModelBuilder_ != null)) { + return v2ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder> + getV2ModelFieldBuilder() { + if (v2ModelBuilder_ == null) { + if (!(modelTypeCase_ == 2)) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + v2ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder>( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 2; + onChanged(); + ; + return v2ModelBuilder_; + } + + @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.language.v1beta2.ClassificationModelOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1beta2.ClassificationModelOptions) + private static final com.google.cloud.language.v1beta2.ClassificationModelOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1beta2.ClassificationModelOptions(); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassificationModelOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationModelOptions(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.language.v1beta2.ClassificationModelOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java new file mode 100644 index 00000000..013c953a --- /dev/null +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java @@ -0,0 +1,109 @@ +/* + * 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/language/v1beta2/language_service.proto + +package com.google.cloud.language.v1beta2; + +public interface ClassificationModelOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1beta2.ClassificationModelOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + boolean hasV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model getV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder(); + + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + boolean hasV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model getV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder(); + + public com.google.cloud.language.v1beta2.ClassificationModelOptions.ModelTypeCase + getModelTypeCase(); +} diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java index 9844702c..ced49eae 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java @@ -82,6 +82,24 @@ private ClassifyTextRequest( document_ = subBuilder.buildPartial(); } + break; + } + case 26: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder subBuilder = + null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -174,6 +192,65 @@ public com.google.cloud.language.v1beta2.DocumentOrBuilder getDocumentOrBuilder( return getDocument(); } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.language.v1beta2.ClassificationModelOptions classificationModelOptions_; + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -191,6 +268,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (document_ != null) { output.writeMessage(1, getDocument()); } + if (classificationModelOptions_ != null) { + output.writeMessage(3, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -203,6 +283,11 @@ public int getSerializedSize() { if (document_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -223,6 +308,11 @@ public boolean equals(final java.lang.Object obj) { if (hasDocument()) { if (!getDocument().equals(other.getDocument())) return false; } + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -238,6 +328,10 @@ public int hashCode() { hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getDocument().hashCode(); } + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -390,6 +484,12 @@ public Builder clear() { document_ = null; documentBuilder_ = null; } + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -422,6 +522,11 @@ public com.google.cloud.language.v1beta2.ClassifyTextRequest buildPartial() { } else { result.document_ = documentBuilder_.build(); } + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -475,6 +580,9 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassifyTextRequest o if (other.hasDocument()) { mergeDocument(other.getDocument()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -708,6 +816,226 @@ public com.google.cloud.language.v1beta2.DocumentOrBuilder getDocumentOrBuilder( return documentBuilder_; } + private com.google.cloud.language.v1beta2.ClassificationModelOptions + classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java index fd30bacb..90c86000 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java @@ -63,4 +63,49 @@ public interface ClassifyTextRequestOrBuilder *
*/ com.google.cloud.language.v1beta2.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java index c77979e9..ad769f87 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java @@ -22,6 +22,7 @@ * * *
+ * ################################################################ #
  * Represents the input to API methods.
  * 
* @@ -40,6 +41,8 @@ private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Document() { type_ = 0; language_ = ""; + referenceWebUri_ = ""; + boilerplateHandling_ = 0; } @java.lang.Override @@ -99,6 +102,20 @@ private Document( language_ = s; break; } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + referenceWebUri_ = s; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + boilerplateHandling_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -292,6 +309,168 @@ private Type(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.language.v1beta2.Document.Type) } + /** + * + * + *
+   * Ways of handling boilerplate detected in the document
+   * 
+ * + * Protobuf enum {@code google.cloud.language.v1beta2.Document.BoilerplateHandling} + */ + public enum BoilerplateHandling implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The boilerplate handling is not specified.
+     * 
+ * + * BOILERPLATE_HANDLING_UNSPECIFIED = 0; + */ + BOILERPLATE_HANDLING_UNSPECIFIED(0), + /** + * + * + *
+     * Do not analyze detected boilerplate. Reference web URI is required for
+     * detecting boilerplate.
+     * 
+ * + * SKIP_BOILERPLATE = 1; + */ + SKIP_BOILERPLATE(1), + /** + * + * + *
+     * Treat boilerplate the same as content.
+     * 
+ * + * KEEP_BOILERPLATE = 2; + */ + KEEP_BOILERPLATE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The boilerplate handling is not specified.
+     * 
+ * + * BOILERPLATE_HANDLING_UNSPECIFIED = 0; + */ + public static final int BOILERPLATE_HANDLING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not analyze detected boilerplate. Reference web URI is required for
+     * detecting boilerplate.
+     * 
+ * + * SKIP_BOILERPLATE = 1; + */ + public static final int SKIP_BOILERPLATE_VALUE = 1; + /** + * + * + *
+     * Treat boilerplate the same as content.
+     * 
+ * + * KEEP_BOILERPLATE = 2; + */ + public static final int KEEP_BOILERPLATE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BoilerplateHandling 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 BoilerplateHandling forNumber(int value) { + switch (value) { + case 0: + return BOILERPLATE_HANDLING_UNSPECIFIED; + case 1: + return SKIP_BOILERPLATE; + case 2: + return KEEP_BOILERPLATE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BoilerplateHandling findValueByNumber(int number) { + return BoilerplateHandling.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.language.v1beta2.Document.getDescriptor().getEnumTypes().get(1); + } + + private static final BoilerplateHandling[] VALUES = values(); + + public static BoilerplateHandling valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private BoilerplateHandling(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.language.v1beta2.Document.BoilerplateHandling) + } + private int sourceCase_ = 0; private java.lang.Object source_; @@ -592,6 +771,102 @@ public com.google.protobuf.ByteString getLanguageBytes() { } } + public static final int REFERENCE_WEB_URI_FIELD_NUMBER = 5; + private volatile java.lang.Object referenceWebUri_; + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The referenceWebUri. + */ + @java.lang.Override + public java.lang.String getReferenceWebUri() { + java.lang.Object ref = referenceWebUri_; + 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(); + referenceWebUri_ = s; + return s; + } + } + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The bytes for referenceWebUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReferenceWebUriBytes() { + java.lang.Object ref = referenceWebUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referenceWebUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOILERPLATE_HANDLING_FIELD_NUMBER = 6; + private int boilerplateHandling_; + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The enum numeric value on the wire for boilerplateHandling. + */ + @java.lang.Override + public int getBoilerplateHandlingValue() { + return boilerplateHandling_; + } + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The boilerplateHandling. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.Document.BoilerplateHandling getBoilerplateHandling() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.Document.BoilerplateHandling result = + com.google.cloud.language.v1beta2.Document.BoilerplateHandling.valueOf( + boilerplateHandling_); + return result == null + ? com.google.cloud.language.v1beta2.Document.BoilerplateHandling.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -618,6 +893,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, language_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceWebUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, referenceWebUri_); + } + if (boilerplateHandling_ + != com.google.cloud.language.v1beta2.Document.BoilerplateHandling + .BOILERPLATE_HANDLING_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, boilerplateHandling_); + } unknownFields.writeTo(output); } @@ -639,6 +923,15 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, language_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceWebUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, referenceWebUri_); + } + if (boilerplateHandling_ + != com.google.cloud.language.v1beta2.Document.BoilerplateHandling + .BOILERPLATE_HANDLING_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, boilerplateHandling_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -657,6 +950,8 @@ public boolean equals(final java.lang.Object obj) { if (type_ != other.type_) return false; if (!getLanguage().equals(other.getLanguage())) return false; + if (!getReferenceWebUri().equals(other.getReferenceWebUri())) return false; + if (boilerplateHandling_ != other.boilerplateHandling_) return false; if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 2: @@ -683,6 +978,10 @@ public int hashCode() { hash = (53 * hash) + type_; hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); + hash = (37 * hash) + REFERENCE_WEB_URI_FIELD_NUMBER; + hash = (53 * hash) + getReferenceWebUri().hashCode(); + hash = (37 * hash) + BOILERPLATE_HANDLING_FIELD_NUMBER; + hash = (53 * hash) + boilerplateHandling_; switch (sourceCase_) { case 2: hash = (37 * hash) + CONTENT_FIELD_NUMBER; @@ -799,6 +1098,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
+   * ################################################################ #
    * Represents the input to API methods.
    * 
* @@ -844,6 +1144,10 @@ public Builder clear() { language_ = ""; + referenceWebUri_ = ""; + + boilerplateHandling_ = 0; + sourceCase_ = 0; source_ = null; return this; @@ -881,6 +1185,8 @@ public com.google.cloud.language.v1beta2.Document buildPartial() { result.source_ = source_; } result.language_ = language_; + result.referenceWebUri_ = referenceWebUri_; + result.boilerplateHandling_ = boilerplateHandling_; result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -938,6 +1244,13 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Document other) { language_ = other.language_; onChanged(); } + if (!other.getReferenceWebUri().isEmpty()) { + referenceWebUri_ = other.referenceWebUri_; + onChanged(); + } + if (other.boilerplateHandling_ != 0) { + setBoilerplateHandlingValue(other.getBoilerplateHandlingValue()); + } switch (other.getSourceCase()) { case CONTENT: { @@ -1530,6 +1843,227 @@ public Builder setLanguageBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object referenceWebUri_ = ""; + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @return The referenceWebUri. + */ + public java.lang.String getReferenceWebUri() { + java.lang.Object ref = referenceWebUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referenceWebUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @return The bytes for referenceWebUri. + */ + public com.google.protobuf.ByteString getReferenceWebUriBytes() { + java.lang.Object ref = referenceWebUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referenceWebUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @param value The referenceWebUri to set. + * @return This builder for chaining. + */ + public Builder setReferenceWebUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referenceWebUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @return This builder for chaining. + */ + public Builder clearReferenceWebUri() { + + referenceWebUri_ = getDefaultInstance().getReferenceWebUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @param value The bytes for referenceWebUri to set. + * @return This builder for chaining. + */ + public Builder setReferenceWebUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referenceWebUri_ = value; + onChanged(); + return this; + } + + private int boilerplateHandling_ = 0; + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The enum numeric value on the wire for boilerplateHandling. + */ + @java.lang.Override + public int getBoilerplateHandlingValue() { + return boilerplateHandling_; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @param value The enum numeric value on the wire for boilerplateHandling to set. + * @return This builder for chaining. + */ + public Builder setBoilerplateHandlingValue(int value) { + + boilerplateHandling_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The boilerplateHandling. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.Document.BoilerplateHandling getBoilerplateHandling() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.Document.BoilerplateHandling result = + com.google.cloud.language.v1beta2.Document.BoilerplateHandling.valueOf( + boilerplateHandling_); + return result == null + ? com.google.cloud.language.v1beta2.Document.BoilerplateHandling.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @param value The boilerplateHandling to set. + * @return This builder for chaining. + */ + public Builder setBoilerplateHandling( + com.google.cloud.language.v1beta2.Document.BoilerplateHandling value) { + if (value == null) { + throw new NullPointerException(); + } + + boilerplateHandling_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearBoilerplateHandling() { + + boilerplateHandling_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java index 09bf845d..88d2576b 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java @@ -175,5 +175,63 @@ public interface DocumentOrBuilder */ com.google.protobuf.ByteString getLanguageBytes(); + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The referenceWebUri. + */ + java.lang.String getReferenceWebUri(); + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The bytes for referenceWebUri. + */ + com.google.protobuf.ByteString getReferenceWebUriBytes(); + + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The enum numeric value on the wire for boilerplateHandling. + */ + int getBoilerplateHandlingValue(); + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The boilerplateHandling. + */ + com.google.cloud.language.v1beta2.Document.BoilerplateHandling getBoilerplateHandling(); + public com.google.cloud.language.v1beta2.Document.SourceCase getSourceCase(); } diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java index 9a8e9ec7..4086c793 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java @@ -71,6 +71,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_language_v1beta2_ClassificationCategory_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_language_v1beta2_ClassificationCategory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -136,218 +148,240 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "_service.proto\022\035google.cloud.language.v1" + "beta2\032\034google/api/annotations.proto\032\027goo" + "gle/api/client.proto\032\037google/api/field_b" - + "ehavior.proto\"\310\001\n\010Document\022:\n\004type\030\001 \001(\016" + + "ehavior.proto\"\247\003\n\010Document\022:\n\004type\030\001 \001(\016" + "2,.google.cloud.language.v1beta2.Documen" + "t.Type\022\021\n\007content\030\002 \001(\tH\000\022\031\n\017gcs_content" - + "_uri\030\003 \001(\tH\000\022\020\n\010language\030\004 \001(\t\"6\n\004Type\022\024" - + "\n\020TYPE_UNSPECIFIED\020\000\022\016\n\nPLAIN_TEXT\020\001\022\010\n\004" - + "HTML\020\002B\010\n\006source\"~\n\010Sentence\0225\n\004text\030\001 \001" - + "(\0132\'.google.cloud.language.v1beta2.TextS" - + "pan\022;\n\tsentiment\030\002 \001(\0132(.google.cloud.la" - + "nguage.v1beta2.Sentiment\"\223\004\n\006Entity\022\014\n\004n" - + "ame\030\001 \001(\t\0228\n\004type\030\002 \001(\0162*.google.cloud.l" - + "anguage.v1beta2.Entity.Type\022E\n\010metadata\030" - + "\003 \003(\01323.google.cloud.language.v1beta2.En" - + "tity.MetadataEntry\022\020\n\010salience\030\004 \001(\002\022>\n\010" - + "mentions\030\005 \003(\0132,.google.cloud.language.v" - + "1beta2.EntityMention\022;\n\tsentiment\030\006 \001(\0132" - + "(.google.cloud.language.v1beta2.Sentimen" - + "t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001\"\271\001\n\004Type\022\013\n\007UNKNOWN\020\000\022\n\n\006PERS" - + "ON\020\001\022\014\n\010LOCATION\020\002\022\020\n\014ORGANIZATION\020\003\022\t\n\005" - + "EVENT\020\004\022\017\n\013WORK_OF_ART\020\005\022\021\n\rCONSUMER_GOO" - + "D\020\006\022\t\n\005OTHER\020\007\022\020\n\014PHONE_NUMBER\020\t\022\013\n\007ADDR" - + "ESS\020\n\022\010\n\004DATE\020\013\022\n\n\006NUMBER\020\014\022\t\n\005PRICE\020\r\"\332" - + "\001\n\005Token\0225\n\004text\030\001 \001(\0132\'.google.cloud.la" - + "nguage.v1beta2.TextSpan\022C\n\016part_of_speec" - + "h\030\002 \001(\0132+.google.cloud.language.v1beta2." - + "PartOfSpeech\022F\n\017dependency_edge\030\003 \001(\0132-." - + "google.cloud.language.v1beta2.Dependency" - + "Edge\022\r\n\005lemma\030\004 \001(\t\"-\n\tSentiment\022\021\n\tmagn" - + "itude\030\002 \001(\002\022\r\n\005score\030\003 \001(\002\"\337\020\n\014PartOfSpe" - + "ech\022<\n\003tag\030\001 \001(\0162/.google.cloud.language" - + ".v1beta2.PartOfSpeech.Tag\022B\n\006aspect\030\002 \001(" - + "\01622.google.cloud.language.v1beta2.PartOf" - + "Speech.Aspect\022>\n\004case\030\003 \001(\01620.google.clo" - + "ud.language.v1beta2.PartOfSpeech.Case\022>\n" - + "\004form\030\004 \001(\01620.google.cloud.language.v1be" - + "ta2.PartOfSpeech.Form\022B\n\006gender\030\005 \001(\01622." - + "google.cloud.language.v1beta2.PartOfSpee" - + "ch.Gender\022>\n\004mood\030\006 \001(\01620.google.cloud.l" - + "anguage.v1beta2.PartOfSpeech.Mood\022B\n\006num" - + "ber\030\007 \001(\01622.google.cloud.language.v1beta" - + "2.PartOfSpeech.Number\022B\n\006person\030\010 \001(\01622." - + "google.cloud.language.v1beta2.PartOfSpee" - + "ch.Person\022B\n\006proper\030\t \001(\01622.google.cloud" - + ".language.v1beta2.PartOfSpeech.Proper\022L\n" - + "\013reciprocity\030\n \001(\01627.google.cloud.langua" - + "ge.v1beta2.PartOfSpeech.Reciprocity\022@\n\005t" - + "ense\030\013 \001(\01621.google.cloud.language.v1bet" - + "a2.PartOfSpeech.Tense\022@\n\005voice\030\014 \001(\01621.g" - + "oogle.cloud.language.v1beta2.PartOfSpeec" - + "h.Voice\"\215\001\n\003Tag\022\013\n\007UNKNOWN\020\000\022\007\n\003ADJ\020\001\022\007\n" - + "\003ADP\020\002\022\007\n\003ADV\020\003\022\010\n\004CONJ\020\004\022\007\n\003DET\020\005\022\010\n\004NO" - + "UN\020\006\022\007\n\003NUM\020\007\022\010\n\004PRON\020\010\022\007\n\003PRT\020\t\022\t\n\005PUNC" - + "T\020\n\022\010\n\004VERB\020\013\022\005\n\001X\020\014\022\t\n\005AFFIX\020\r\"O\n\006Aspec" - + "t\022\022\n\016ASPECT_UNKNOWN\020\000\022\016\n\nPERFECTIVE\020\001\022\020\n" - + "\014IMPERFECTIVE\020\002\022\017\n\013PROGRESSIVE\020\003\"\370\001\n\004Cas" - + "e\022\020\n\014CASE_UNKNOWN\020\000\022\016\n\nACCUSATIVE\020\001\022\r\n\tA" - + "DVERBIAL\020\002\022\021\n\rCOMPLEMENTIVE\020\003\022\n\n\006DATIVE\020" - + "\004\022\014\n\010GENITIVE\020\005\022\020\n\014INSTRUMENTAL\020\006\022\014\n\010LOC" - + "ATIVE\020\007\022\016\n\nNOMINATIVE\020\010\022\013\n\007OBLIQUE\020\t\022\r\n\t" - + "PARTITIVE\020\n\022\021\n\rPREPOSITIONAL\020\013\022\022\n\016REFLEX" - + "IVE_CASE\020\014\022\021\n\rRELATIVE_CASE\020\r\022\014\n\010VOCATIV" - + "E\020\016\"\257\001\n\004Form\022\020\n\014FORM_UNKNOWN\020\000\022\014\n\010ADNOMI" - + "AL\020\001\022\r\n\tAUXILIARY\020\002\022\022\n\016COMPLEMENTIZER\020\003\022" - + "\020\n\014FINAL_ENDING\020\004\022\n\n\006GERUND\020\005\022\n\n\006REALIS\020" - + "\006\022\014\n\010IRREALIS\020\007\022\t\n\005SHORT\020\010\022\010\n\004LONG\020\t\022\t\n\005" - + "ORDER\020\n\022\014\n\010SPECIFIC\020\013\"E\n\006Gender\022\022\n\016GENDE" - + "R_UNKNOWN\020\000\022\014\n\010FEMININE\020\001\022\r\n\tMASCULINE\020\002" - + "\022\n\n\006NEUTER\020\003\"\177\n\004Mood\022\020\n\014MOOD_UNKNOWN\020\000\022\024" - + "\n\020CONDITIONAL_MOOD\020\001\022\016\n\nIMPERATIVE\020\002\022\016\n\n" - + "INDICATIVE\020\003\022\021\n\rINTERROGATIVE\020\004\022\013\n\007JUSSI" - + "VE\020\005\022\017\n\013SUBJUNCTIVE\020\006\"@\n\006Number\022\022\n\016NUMBE" - + "R_UNKNOWN\020\000\022\014\n\010SINGULAR\020\001\022\n\n\006PLURAL\020\002\022\010\n" - + "\004DUAL\020\003\"T\n\006Person\022\022\n\016PERSON_UNKNOWN\020\000\022\t\n" - + "\005FIRST\020\001\022\n\n\006SECOND\020\002\022\t\n\005THIRD\020\003\022\024\n\020REFLE" - + "XIVE_PERSON\020\004\"8\n\006Proper\022\022\n\016PROPER_UNKNOW" - + "N\020\000\022\n\n\006PROPER\020\001\022\016\n\nNOT_PROPER\020\002\"J\n\013Recip" - + "rocity\022\027\n\023RECIPROCITY_UNKNOWN\020\000\022\016\n\nRECIP" - + "ROCAL\020\001\022\022\n\016NON_RECIPROCAL\020\002\"s\n\005Tense\022\021\n\r" - + "TENSE_UNKNOWN\020\000\022\025\n\021CONDITIONAL_TENSE\020\001\022\n" - + "\n\006FUTURE\020\002\022\010\n\004PAST\020\003\022\013\n\007PRESENT\020\004\022\r\n\tIMP" - + "ERFECT\020\005\022\016\n\nPLUPERFECT\020\006\"B\n\005Voice\022\021\n\rVOI" - + "CE_UNKNOWN\020\000\022\n\n\006ACTIVE\020\001\022\r\n\tCAUSATIVE\020\002\022" - + "\013\n\007PASSIVE\020\003\"\232\010\n\016DependencyEdge\022\030\n\020head_" - + "token_index\030\001 \001(\005\022B\n\005label\030\002 \001(\01623.googl" - + "e.cloud.language.v1beta2.DependencyEdge." - + "Label\"\251\007\n\005Label\022\013\n\007UNKNOWN\020\000\022\n\n\006ABBREV\020\001" - + "\022\t\n\005ACOMP\020\002\022\t\n\005ADVCL\020\003\022\n\n\006ADVMOD\020\004\022\010\n\004AM" - + "OD\020\005\022\t\n\005APPOS\020\006\022\010\n\004ATTR\020\007\022\007\n\003AUX\020\010\022\013\n\007AU" - + "XPASS\020\t\022\006\n\002CC\020\n\022\t\n\005CCOMP\020\013\022\010\n\004CONJ\020\014\022\t\n\005" - + "CSUBJ\020\r\022\r\n\tCSUBJPASS\020\016\022\007\n\003DEP\020\017\022\007\n\003DET\020\020" - + "\022\r\n\tDISCOURSE\020\021\022\010\n\004DOBJ\020\022\022\010\n\004EXPL\020\023\022\014\n\010G" - + "OESWITH\020\024\022\010\n\004IOBJ\020\025\022\010\n\004MARK\020\026\022\007\n\003MWE\020\027\022\007" - + "\n\003MWV\020\030\022\007\n\003NEG\020\031\022\006\n\002NN\020\032\022\014\n\010NPADVMOD\020\033\022\t" - + "\n\005NSUBJ\020\034\022\r\n\tNSUBJPASS\020\035\022\007\n\003NUM\020\036\022\n\n\006NUM" - + "BER\020\037\022\005\n\001P\020 \022\r\n\tPARATAXIS\020!\022\013\n\007PARTMOD\020\"" - + "\022\t\n\005PCOMP\020#\022\010\n\004POBJ\020$\022\010\n\004POSS\020%\022\013\n\007POSTN" - + "EG\020&\022\013\n\007PRECOMP\020\'\022\013\n\007PRECONJ\020(\022\n\n\006PREDET" - + "\020)\022\010\n\004PREF\020*\022\010\n\004PREP\020+\022\t\n\005PRONL\020,\022\007\n\003PRT" - + "\020-\022\006\n\002PS\020.\022\014\n\010QUANTMOD\020/\022\t\n\005RCMOD\0200\022\014\n\010R" - + "CMODREL\0201\022\t\n\005RDROP\0202\022\007\n\003REF\0203\022\013\n\007REMNANT" - + "\0204\022\016\n\nREPARANDUM\0205\022\010\n\004ROOT\0206\022\010\n\004SNUM\0207\022\010" - + "\n\004SUFF\0208\022\010\n\004TMOD\0209\022\t\n\005TOPIC\020:\022\010\n\004VMOD\020;\022" - + "\014\n\010VOCATIVE\020<\022\t\n\005XCOMP\020=\022\n\n\006SUFFIX\020>\022\t\n\005" - + "TITLE\020?\022\014\n\010ADVPHMOD\020@\022\013\n\007AUXCAUS\020A\022\t\n\005AU" - + "XVV\020B\022\t\n\005DTMOD\020C\022\013\n\007FOREIGN\020D\022\006\n\002KW\020E\022\010\n" - + "\004LIST\020F\022\010\n\004NOMC\020G\022\014\n\010NOMCSUBJ\020H\022\020\n\014NOMCS" - + "UBJPASS\020I\022\010\n\004NUMC\020J\022\007\n\003COP\020K\022\016\n\nDISLOCAT" - + "ED\020L\022\007\n\003ASP\020M\022\010\n\004GMOD\020N\022\010\n\004GOBJ\020O\022\n\n\006INF" - + "MOD\020P\022\007\n\003MES\020Q\022\t\n\005NCOMP\020R\"\366\001\n\rEntityMent" - + "ion\0225\n\004text\030\001 \001(\0132\'.google.cloud.languag" - + "e.v1beta2.TextSpan\022?\n\004type\030\002 \001(\01621.googl" - + "e.cloud.language.v1beta2.EntityMention.T" - + "ype\022;\n\tsentiment\030\003 \001(\0132(.google.cloud.la" - + "nguage.v1beta2.Sentiment\"0\n\004Type\022\020\n\014TYPE" - + "_UNKNOWN\020\000\022\n\n\006PROPER\020\001\022\n\n\006COMMON\020\002\"1\n\010Te" - + "xtSpan\022\017\n\007content\030\001 \001(\t\022\024\n\014begin_offset\030" - + "\002 \001(\005\":\n\026ClassificationCategory\022\014\n\004name\030" - + "\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\"\235\001\n\027AnalyzeSen" - + "timentRequest\022>\n\010document\030\001 \001(\0132\'.google" - + ".cloud.language.v1beta2.DocumentB\003\340A\002\022B\n" - + "\rencoding_type\030\002 \001(\0162+.google.cloud.lang" - + "uage.v1beta2.EncodingType\"\256\001\n\030AnalyzeSen" - + "timentResponse\022D\n\022document_sentiment\030\001 \001" - + "(\0132(.google.cloud.language.v1beta2.Senti" - + "ment\022\020\n\010language\030\002 \001(\t\022:\n\tsentences\030\003 \003(" - + "\0132\'.google.cloud.language.v1beta2.Senten" - + "ce\"\243\001\n\035AnalyzeEntitySentimentRequest\022>\n\010" - + "document\030\001 \001(\0132\'.google.cloud.language.v" - + "1beta2.DocumentB\003\340A\002\022B\n\rencoding_type\030\002 " - + "\001(\0162+.google.cloud.language.v1beta2.Enco" - + "dingType\"k\n\036AnalyzeEntitySentimentRespon" - + "se\0227\n\010entities\030\001 \003(\0132%.google.cloud.lang" - + "uage.v1beta2.Entity\022\020\n\010language\030\002 \001(\t\"\234\001" - + "\n\026AnalyzeEntitiesRequest\022>\n\010document\030\001 \001" - + "(\0132\'.google.cloud.language.v1beta2.Docum" - + "entB\003\340A\002\022B\n\rencoding_type\030\002 \001(\0162+.google" - + ".cloud.language.v1beta2.EncodingType\"d\n\027" - + "AnalyzeEntitiesResponse\0227\n\010entities\030\001 \003(" - + "\0132%.google.cloud.language.v1beta2.Entity" - + "\022\020\n\010language\030\002 \001(\t\"\232\001\n\024AnalyzeSyntaxRequ" - + "est\022>\n\010document\030\001 \001(\0132\'.google.cloud.lan" - + "guage.v1beta2.DocumentB\003\340A\002\022B\n\rencoding_" - + "type\030\002 \001(\0162+.google.cloud.language.v1bet" - + "a2.EncodingType\"\233\001\n\025AnalyzeSyntaxRespons" - + "e\022:\n\tsentences\030\001 \003(\0132\'.google.cloud.lang" - + "uage.v1beta2.Sentence\0224\n\006tokens\030\002 \003(\0132$." - + "google.cloud.language.v1beta2.Token\022\020\n\010l" - + "anguage\030\003 \001(\t\"U\n\023ClassifyTextRequest\022>\n\010" - + "document\030\001 \001(\0132\'.google.cloud.language.v" - + "1beta2.DocumentB\003\340A\002\"a\n\024ClassifyTextResp" - + "onse\022I\n\ncategories\030\001 \003(\01325.google.cloud." - + "language.v1beta2.ClassificationCategory\"" - + "\211\003\n\023AnnotateTextRequest\022>\n\010document\030\001 \001(" - + "\0132\'.google.cloud.language.v1beta2.Docume" - + "ntB\003\340A\002\022R\n\010features\030\002 \001(\0132;.google.cloud" - + ".language.v1beta2.AnnotateTextRequest.Fe" - + "aturesB\003\340A\002\022B\n\rencoding_type\030\003 \001(\0162+.goo" - + "gle.cloud.language.v1beta2.EncodingType\032" - + "\231\001\n\010Features\022\026\n\016extract_syntax\030\001 \001(\010\022\030\n\020" - + "extract_entities\030\002 \001(\010\022\"\n\032extract_docume" - + "nt_sentiment\030\003 \001(\010\022 \n\030extract_entity_sen" - + "timent\030\004 \001(\010\022\025\n\rclassify_text\030\006 \001(\010\"\344\002\n\024" - + "AnnotateTextResponse\022:\n\tsentences\030\001 \003(\0132" - + "\'.google.cloud.language.v1beta2.Sentence" - + "\0224\n\006tokens\030\002 \003(\0132$.google.cloud.language" - + ".v1beta2.Token\0227\n\010entities\030\003 \003(\0132%.googl" - + "e.cloud.language.v1beta2.Entity\022D\n\022docum" - + "ent_sentiment\030\004 \001(\0132(.google.cloud.langu" - + "age.v1beta2.Sentiment\022\020\n\010language\030\005 \001(\t\022" - + "I\n\ncategories\030\006 \003(\01325.google.cloud.langu" - + "age.v1beta2.ClassificationCategory*8\n\014En" - + "codingType\022\010\n\004NONE\020\000\022\010\n\004UTF8\020\001\022\t\n\005UTF16\020" - + "\002\022\t\n\005UTF32\020\0032\212\013\n\017LanguageService\022\327\001\n\020Ana" - + "lyzeSentiment\0226.google.cloud.language.v1" - + "beta2.AnalyzeSentimentRequest\0327.google.c" - + "loud.language.v1beta2.AnalyzeSentimentRe" - + "sponse\"R\202\323\344\223\002(\"#/v1beta2/documents:analy" - + "zeSentiment:\001*\332A\026document,encoding_type\332" - + "A\010document\022\323\001\n\017AnalyzeEntities\0225.google." - + "cloud.language.v1beta2.AnalyzeEntitiesRe" - + "quest\0326.google.cloud.language.v1beta2.An" - + "alyzeEntitiesResponse\"Q\202\323\344\223\002\'\"\"/v1beta2/" - + "documents:analyzeEntities:\001*\332A\026document," - + "encoding_type\332A\010document\022\357\001\n\026AnalyzeEnti" - + "tySentiment\022<.google.cloud.language.v1be" - + "ta2.AnalyzeEntitySentimentRequest\032=.goog" - + "le.cloud.language.v1beta2.AnalyzeEntityS" - + "entimentResponse\"X\202\323\344\223\002.\")/v1beta2/docum" - + "ents:analyzeEntitySentiment:\001*\332A\026documen" - + "t,encoding_type\332A\010document\022\313\001\n\rAnalyzeSy" - + "ntax\0223.google.cloud.language.v1beta2.Ana" - + "lyzeSyntaxRequest\0324.google.cloud.languag" - + "e.v1beta2.AnalyzeSyntaxResponse\"O\202\323\344\223\002%\"" - + " /v1beta2/documents:analyzeSyntax:\001*\332A\026d" - + "ocument,encoding_type\332A\010document\022\256\001\n\014Cla" - + "ssifyText\0222.google.cloud.language.v1beta" - + "2.ClassifyTextRequest\0323.google.cloud.lan" - + "guage.v1beta2.ClassifyTextResponse\"5\202\323\344\223" - + "\002$\"\037/v1beta2/documents:classifyText:\001*\332A" - + "\010document\022\331\001\n\014AnnotateText\0222.google.clou" - + "d.language.v1beta2.AnnotateTextRequest\0323" - + ".google.cloud.language.v1beta2.AnnotateT" - + "extResponse\"`\202\323\344\223\002$\"\037/v1beta2/documents:" - + "annotateText:\001*\332A\037document,features,enco" - + "ding_type\332A\021document,features\032z\312A\027langua" - + "ge.googleapis.com\322A]https://www.googleap" - + "is.com/auth/cloud-language,https://www.g" - + "oogleapis.com/auth/cloud-platformB\202\001\n!co" - + "m.google.cloud.language.v1beta2B\024Languag" - + "eServiceProtoP\001ZEgoogle.golang.org/genpr" - + "oto/googleapis/cloud/language/v1beta2;la" - + "nguageb\006proto3" + + "_uri\030\003 \001(\tH\000\022\020\n\010language\030\004 \001(\t\022\031\n\021refere" + + "nce_web_uri\030\005 \001(\t\022Y\n\024boilerplate_handlin" + + "g\030\006 \001(\0162;.google.cloud.language.v1beta2." + + "Document.BoilerplateHandling\"6\n\004Type\022\024\n\020" + + "TYPE_UNSPECIFIED\020\000\022\016\n\nPLAIN_TEXT\020\001\022\010\n\004HT" + + "ML\020\002\"g\n\023BoilerplateHandling\022$\n BOILERPLA" + + "TE_HANDLING_UNSPECIFIED\020\000\022\024\n\020SKIP_BOILER" + + "PLATE\020\001\022\024\n\020KEEP_BOILERPLATE\020\002B\010\n\006source\"" + + "~\n\010Sentence\0225\n\004text\030\001 \001(\0132\'.google.cloud" + + ".language.v1beta2.TextSpan\022;\n\tsentiment\030" + + "\002 \001(\0132(.google.cloud.language.v1beta2.Se" + + "ntiment\"\223\004\n\006Entity\022\014\n\004name\030\001 \001(\t\0228\n\004type" + + "\030\002 \001(\0162*.google.cloud.language.v1beta2.E" + + "ntity.Type\022E\n\010metadata\030\003 \003(\01323.google.cl" + + "oud.language.v1beta2.Entity.MetadataEntr" + + "y\022\020\n\010salience\030\004 \001(\002\022>\n\010mentions\030\005 \003(\0132,." + + "google.cloud.language.v1beta2.EntityMent" + + "ion\022;\n\tsentiment\030\006 \001(\0132(.google.cloud.la" + + "nguage.v1beta2.Sentiment\032/\n\rMetadataEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\271\001\n\004Ty" + + "pe\022\013\n\007UNKNOWN\020\000\022\n\n\006PERSON\020\001\022\014\n\010LOCATION\020" + + "\002\022\020\n\014ORGANIZATION\020\003\022\t\n\005EVENT\020\004\022\017\n\013WORK_O" + + "F_ART\020\005\022\021\n\rCONSUMER_GOOD\020\006\022\t\n\005OTHER\020\007\022\020\n" + + "\014PHONE_NUMBER\020\t\022\013\n\007ADDRESS\020\n\022\010\n\004DATE\020\013\022\n" + + "\n\006NUMBER\020\014\022\t\n\005PRICE\020\r\"\332\001\n\005Token\0225\n\004text\030" + + "\001 \001(\0132\'.google.cloud.language.v1beta2.Te" + + "xtSpan\022C\n\016part_of_speech\030\002 \001(\0132+.google." + + "cloud.language.v1beta2.PartOfSpeech\022F\n\017d" + + "ependency_edge\030\003 \001(\0132-.google.cloud.lang" + + "uage.v1beta2.DependencyEdge\022\r\n\005lemma\030\004 \001" + + "(\t\"-\n\tSentiment\022\021\n\tmagnitude\030\002 \001(\002\022\r\n\005sc" + + "ore\030\003 \001(\002\"\337\020\n\014PartOfSpeech\022<\n\003tag\030\001 \001(\0162" + + "/.google.cloud.language.v1beta2.PartOfSp" + + "eech.Tag\022B\n\006aspect\030\002 \001(\01622.google.cloud." + + "language.v1beta2.PartOfSpeech.Aspect\022>\n\004" + + "case\030\003 \001(\01620.google.cloud.language.v1bet" + + "a2.PartOfSpeech.Case\022>\n\004form\030\004 \001(\01620.goo" + + "gle.cloud.language.v1beta2.PartOfSpeech." + + "Form\022B\n\006gender\030\005 \001(\01622.google.cloud.lang" + + "uage.v1beta2.PartOfSpeech.Gender\022>\n\004mood" + + "\030\006 \001(\01620.google.cloud.language.v1beta2.P" + + "artOfSpeech.Mood\022B\n\006number\030\007 \001(\01622.googl" + + "e.cloud.language.v1beta2.PartOfSpeech.Nu" + + "mber\022B\n\006person\030\010 \001(\01622.google.cloud.lang" + + "uage.v1beta2.PartOfSpeech.Person\022B\n\006prop" + + "er\030\t \001(\01622.google.cloud.language.v1beta2" + + ".PartOfSpeech.Proper\022L\n\013reciprocity\030\n \001(" + + "\01627.google.cloud.language.v1beta2.PartOf" + + "Speech.Reciprocity\022@\n\005tense\030\013 \001(\01621.goog" + + "le.cloud.language.v1beta2.PartOfSpeech.T" + + "ense\022@\n\005voice\030\014 \001(\01621.google.cloud.langu" + + "age.v1beta2.PartOfSpeech.Voice\"\215\001\n\003Tag\022\013" + + "\n\007UNKNOWN\020\000\022\007\n\003ADJ\020\001\022\007\n\003ADP\020\002\022\007\n\003ADV\020\003\022\010" + + "\n\004CONJ\020\004\022\007\n\003DET\020\005\022\010\n\004NOUN\020\006\022\007\n\003NUM\020\007\022\010\n\004" + + "PRON\020\010\022\007\n\003PRT\020\t\022\t\n\005PUNCT\020\n\022\010\n\004VERB\020\013\022\005\n\001" + + "X\020\014\022\t\n\005AFFIX\020\r\"O\n\006Aspect\022\022\n\016ASPECT_UNKNO" + + "WN\020\000\022\016\n\nPERFECTIVE\020\001\022\020\n\014IMPERFECTIVE\020\002\022\017" + + "\n\013PROGRESSIVE\020\003\"\370\001\n\004Case\022\020\n\014CASE_UNKNOWN" + + "\020\000\022\016\n\nACCUSATIVE\020\001\022\r\n\tADVERBIAL\020\002\022\021\n\rCOM" + + "PLEMENTIVE\020\003\022\n\n\006DATIVE\020\004\022\014\n\010GENITIVE\020\005\022\020" + + "\n\014INSTRUMENTAL\020\006\022\014\n\010LOCATIVE\020\007\022\016\n\nNOMINA" + + "TIVE\020\010\022\013\n\007OBLIQUE\020\t\022\r\n\tPARTITIVE\020\n\022\021\n\rPR" + + "EPOSITIONAL\020\013\022\022\n\016REFLEXIVE_CASE\020\014\022\021\n\rREL" + + "ATIVE_CASE\020\r\022\014\n\010VOCATIVE\020\016\"\257\001\n\004Form\022\020\n\014F" + + "ORM_UNKNOWN\020\000\022\014\n\010ADNOMIAL\020\001\022\r\n\tAUXILIARY" + + "\020\002\022\022\n\016COMPLEMENTIZER\020\003\022\020\n\014FINAL_ENDING\020\004" + + "\022\n\n\006GERUND\020\005\022\n\n\006REALIS\020\006\022\014\n\010IRREALIS\020\007\022\t" + + "\n\005SHORT\020\010\022\010\n\004LONG\020\t\022\t\n\005ORDER\020\n\022\014\n\010SPECIF" + + "IC\020\013\"E\n\006Gender\022\022\n\016GENDER_UNKNOWN\020\000\022\014\n\010FE" + + "MININE\020\001\022\r\n\tMASCULINE\020\002\022\n\n\006NEUTER\020\003\"\177\n\004M" + + "ood\022\020\n\014MOOD_UNKNOWN\020\000\022\024\n\020CONDITIONAL_MOO" + + "D\020\001\022\016\n\nIMPERATIVE\020\002\022\016\n\nINDICATIVE\020\003\022\021\n\rI" + + "NTERROGATIVE\020\004\022\013\n\007JUSSIVE\020\005\022\017\n\013SUBJUNCTI" + + "VE\020\006\"@\n\006Number\022\022\n\016NUMBER_UNKNOWN\020\000\022\014\n\010SI" + + "NGULAR\020\001\022\n\n\006PLURAL\020\002\022\010\n\004DUAL\020\003\"T\n\006Person" + + "\022\022\n\016PERSON_UNKNOWN\020\000\022\t\n\005FIRST\020\001\022\n\n\006SECON" + + "D\020\002\022\t\n\005THIRD\020\003\022\024\n\020REFLEXIVE_PERSON\020\004\"8\n\006" + + "Proper\022\022\n\016PROPER_UNKNOWN\020\000\022\n\n\006PROPER\020\001\022\016" + + "\n\nNOT_PROPER\020\002\"J\n\013Reciprocity\022\027\n\023RECIPRO" + + "CITY_UNKNOWN\020\000\022\016\n\nRECIPROCAL\020\001\022\022\n\016NON_RE" + + "CIPROCAL\020\002\"s\n\005Tense\022\021\n\rTENSE_UNKNOWN\020\000\022\025" + + "\n\021CONDITIONAL_TENSE\020\001\022\n\n\006FUTURE\020\002\022\010\n\004PAS" + + "T\020\003\022\013\n\007PRESENT\020\004\022\r\n\tIMPERFECT\020\005\022\016\n\nPLUPE" + + "RFECT\020\006\"B\n\005Voice\022\021\n\rVOICE_UNKNOWN\020\000\022\n\n\006A" + + "CTIVE\020\001\022\r\n\tCAUSATIVE\020\002\022\013\n\007PASSIVE\020\003\"\232\010\n\016" + + "DependencyEdge\022\030\n\020head_token_index\030\001 \001(\005" + + "\022B\n\005label\030\002 \001(\01623.google.cloud.language." + + "v1beta2.DependencyEdge.Label\"\251\007\n\005Label\022\013" + + "\n\007UNKNOWN\020\000\022\n\n\006ABBREV\020\001\022\t\n\005ACOMP\020\002\022\t\n\005AD" + + "VCL\020\003\022\n\n\006ADVMOD\020\004\022\010\n\004AMOD\020\005\022\t\n\005APPOS\020\006\022\010" + + "\n\004ATTR\020\007\022\007\n\003AUX\020\010\022\013\n\007AUXPASS\020\t\022\006\n\002CC\020\n\022\t" + + "\n\005CCOMP\020\013\022\010\n\004CONJ\020\014\022\t\n\005CSUBJ\020\r\022\r\n\tCSUBJP" + + "ASS\020\016\022\007\n\003DEP\020\017\022\007\n\003DET\020\020\022\r\n\tDISCOURSE\020\021\022\010" + + "\n\004DOBJ\020\022\022\010\n\004EXPL\020\023\022\014\n\010GOESWITH\020\024\022\010\n\004IOBJ" + + "\020\025\022\010\n\004MARK\020\026\022\007\n\003MWE\020\027\022\007\n\003MWV\020\030\022\007\n\003NEG\020\031\022" + + "\006\n\002NN\020\032\022\014\n\010NPADVMOD\020\033\022\t\n\005NSUBJ\020\034\022\r\n\tNSUB" + + "JPASS\020\035\022\007\n\003NUM\020\036\022\n\n\006NUMBER\020\037\022\005\n\001P\020 \022\r\n\tP" + + "ARATAXIS\020!\022\013\n\007PARTMOD\020\"\022\t\n\005PCOMP\020#\022\010\n\004PO" + + "BJ\020$\022\010\n\004POSS\020%\022\013\n\007POSTNEG\020&\022\013\n\007PRECOMP\020\'" + + "\022\013\n\007PRECONJ\020(\022\n\n\006PREDET\020)\022\010\n\004PREF\020*\022\010\n\004P" + + "REP\020+\022\t\n\005PRONL\020,\022\007\n\003PRT\020-\022\006\n\002PS\020.\022\014\n\010QUA" + + "NTMOD\020/\022\t\n\005RCMOD\0200\022\014\n\010RCMODREL\0201\022\t\n\005RDRO" + + "P\0202\022\007\n\003REF\0203\022\013\n\007REMNANT\0204\022\016\n\nREPARANDUM\020" + + "5\022\010\n\004ROOT\0206\022\010\n\004SNUM\0207\022\010\n\004SUFF\0208\022\010\n\004TMOD\020" + + "9\022\t\n\005TOPIC\020:\022\010\n\004VMOD\020;\022\014\n\010VOCATIVE\020<\022\t\n\005" + + "XCOMP\020=\022\n\n\006SUFFIX\020>\022\t\n\005TITLE\020?\022\014\n\010ADVPHM" + + "OD\020@\022\013\n\007AUXCAUS\020A\022\t\n\005AUXVV\020B\022\t\n\005DTMOD\020C\022" + + "\013\n\007FOREIGN\020D\022\006\n\002KW\020E\022\010\n\004LIST\020F\022\010\n\004NOMC\020G" + + "\022\014\n\010NOMCSUBJ\020H\022\020\n\014NOMCSUBJPASS\020I\022\010\n\004NUMC" + + "\020J\022\007\n\003COP\020K\022\016\n\nDISLOCATED\020L\022\007\n\003ASP\020M\022\010\n\004" + + "GMOD\020N\022\010\n\004GOBJ\020O\022\n\n\006INFMOD\020P\022\007\n\003MES\020Q\022\t\n" + + "\005NCOMP\020R\"\366\001\n\rEntityMention\0225\n\004text\030\001 \001(\013" + + "2\'.google.cloud.language.v1beta2.TextSpa" + + "n\022?\n\004type\030\002 \001(\01621.google.cloud.language." + + "v1beta2.EntityMention.Type\022;\n\tsentiment\030" + + "\003 \001(\0132(.google.cloud.language.v1beta2.Se" + + "ntiment\"0\n\004Type\022\020\n\014TYPE_UNKNOWN\020\000\022\n\n\006PRO" + + "PER\020\001\022\n\n\006COMMON\020\002\"1\n\010TextSpan\022\017\n\007content" + + "\030\001 \001(\t\022\024\n\014begin_offset\030\002 \001(\005\":\n\026Classifi" + + "cationCategory\022\014\n\004name\030\001 \001(\t\022\022\n\nconfiden" + + "ce\030\002 \001(\002\"\307\003\n\032ClassificationModelOptions\022" + + "U\n\010v1_model\030\001 \001(\0132A.google.cloud.languag" + + "e.v1beta2.ClassificationModelOptions.V1M" + + "odelH\000\022U\n\010v2_model\030\002 \001(\0132A.google.cloud." + + "language.v1beta2.ClassificationModelOpti" + + "ons.V2ModelH\000\032\t\n\007V1Model\032\341\001\n\007V2Model\022~\n\032" + + "content_categories_version\030\001 \001(\0162Z.googl" + + "e.cloud.language.v1beta2.ClassificationM" + + "odelOptions.V2Model.ContentCategoriesVer" + + "sion\"V\n\030ContentCategoriesVersion\022*\n&CONT" + + "ENT_CATEGORIES_VERSION_UNSPECIFIED\020\000\022\006\n\002" + + "V1\020\001\022\006\n\002V2\020\002B\014\n\nmodel_type\"\235\001\n\027AnalyzeSe" + + "ntimentRequest\022>\n\010document\030\001 \001(\0132\'.googl" + + "e.cloud.language.v1beta2.DocumentB\003\340A\002\022B" + + "\n\rencoding_type\030\002 \001(\0162+.google.cloud.lan" + + "guage.v1beta2.EncodingType\"\256\001\n\030AnalyzeSe" + + "ntimentResponse\022D\n\022document_sentiment\030\001 " + + "\001(\0132(.google.cloud.language.v1beta2.Sent" + + "iment\022\020\n\010language\030\002 \001(\t\022:\n\tsentences\030\003 \003" + + "(\0132\'.google.cloud.language.v1beta2.Sente" + + "nce\"\243\001\n\035AnalyzeEntitySentimentRequest\022>\n" + + "\010document\030\001 \001(\0132\'.google.cloud.language." + + "v1beta2.DocumentB\003\340A\002\022B\n\rencoding_type\030\002" + + " \001(\0162+.google.cloud.language.v1beta2.Enc" + + "odingType\"k\n\036AnalyzeEntitySentimentRespo" + + "nse\0227\n\010entities\030\001 \003(\0132%.google.cloud.lan" + + "guage.v1beta2.Entity\022\020\n\010language\030\002 \001(\t\"\234" + + "\001\n\026AnalyzeEntitiesRequest\022>\n\010document\030\001 " + + "\001(\0132\'.google.cloud.language.v1beta2.Docu" + + "mentB\003\340A\002\022B\n\rencoding_type\030\002 \001(\0162+.googl" + + "e.cloud.language.v1beta2.EncodingType\"d\n" + + "\027AnalyzeEntitiesResponse\0227\n\010entities\030\001 \003" + + "(\0132%.google.cloud.language.v1beta2.Entit" + + "y\022\020\n\010language\030\002 \001(\t\"\232\001\n\024AnalyzeSyntaxReq" + + "uest\022>\n\010document\030\001 \001(\0132\'.google.cloud.la" + + "nguage.v1beta2.DocumentB\003\340A\002\022B\n\rencoding" + + "_type\030\002 \001(\0162+.google.cloud.language.v1be" + + "ta2.EncodingType\"\233\001\n\025AnalyzeSyntaxRespon" + + "se\022:\n\tsentences\030\001 \003(\0132\'.google.cloud.lan" + + "guage.v1beta2.Sentence\0224\n\006tokens\030\002 \003(\0132$" + + ".google.cloud.language.v1beta2.Token\022\020\n\010" + + "language\030\003 \001(\t\"\266\001\n\023ClassifyTextRequest\022>" + + "\n\010document\030\001 \001(\0132\'.google.cloud.language" + + ".v1beta2.DocumentB\003\340A\002\022_\n\034classification" + + "_model_options\030\003 \001(\01329.google.cloud.lang" + + "uage.v1beta2.ClassificationModelOptions\"" + + "a\n\024ClassifyTextResponse\022I\n\ncategories\030\001 " + + "\003(\01325.google.cloud.language.v1beta2.Clas" + + "sificationCategory\"\352\003\n\023AnnotateTextReque" + + "st\022>\n\010document\030\001 \001(\0132\'.google.cloud.lang" + + "uage.v1beta2.DocumentB\003\340A\002\022R\n\010features\030\002" + + " \001(\0132;.google.cloud.language.v1beta2.Ann" + + "otateTextRequest.FeaturesB\003\340A\002\022B\n\rencodi" + + "ng_type\030\003 \001(\0162+.google.cloud.language.v1" + + "beta2.EncodingType\032\372\001\n\010Features\022\026\n\016extra" + + "ct_syntax\030\001 \001(\010\022\030\n\020extract_entities\030\002 \001(" + + "\010\022\"\n\032extract_document_sentiment\030\003 \001(\010\022 \n" + + "\030extract_entity_sentiment\030\004 \001(\010\022\025\n\rclass" + + "ify_text\030\006 \001(\010\022_\n\034classification_model_o" + + "ptions\030\n \001(\01329.google.cloud.language.v1b" + + "eta2.ClassificationModelOptions\"\344\002\n\024Anno" + + "tateTextResponse\022:\n\tsentences\030\001 \003(\0132\'.go" + + "ogle.cloud.language.v1beta2.Sentence\0224\n\006" + + "tokens\030\002 \003(\0132$.google.cloud.language.v1b" + + "eta2.Token\0227\n\010entities\030\003 \003(\0132%.google.cl" + + "oud.language.v1beta2.Entity\022D\n\022document_" + + "sentiment\030\004 \001(\0132(.google.cloud.language." + + "v1beta2.Sentiment\022\020\n\010language\030\005 \001(\t\022I\n\nc" + + "ategories\030\006 \003(\01325.google.cloud.language." + + "v1beta2.ClassificationCategory*8\n\014Encodi" + + "ngType\022\010\n\004NONE\020\000\022\010\n\004UTF8\020\001\022\t\n\005UTF16\020\002\022\t\n" + + "\005UTF32\020\0032\212\013\n\017LanguageService\022\327\001\n\020Analyze" + + "Sentiment\0226.google.cloud.language.v1beta" + + "2.AnalyzeSentimentRequest\0327.google.cloud" + + ".language.v1beta2.AnalyzeSentimentRespon" + + "se\"R\202\323\344\223\002(\"#/v1beta2/documents:analyzeSe" + + "ntiment:\001*\332A\026document,encoding_type\332A\010do" + + "cument\022\323\001\n\017AnalyzeEntities\0225.google.clou" + + "d.language.v1beta2.AnalyzeEntitiesReques" + + "t\0326.google.cloud.language.v1beta2.Analyz" + + "eEntitiesResponse\"Q\202\323\344\223\002\'\"\"/v1beta2/docu" + + "ments:analyzeEntities:\001*\332A\026document,enco" + + "ding_type\332A\010document\022\357\001\n\026AnalyzeEntitySe" + + "ntiment\022<.google.cloud.language.v1beta2." + + "AnalyzeEntitySentimentRequest\032=.google.c" + + "loud.language.v1beta2.AnalyzeEntitySenti" + + "mentResponse\"X\202\323\344\223\002.\")/v1beta2/documents" + + ":analyzeEntitySentiment:\001*\332A\026document,en" + + "coding_type\332A\010document\022\313\001\n\rAnalyzeSyntax" + + "\0223.google.cloud.language.v1beta2.Analyze" + + "SyntaxRequest\0324.google.cloud.language.v1" + + "beta2.AnalyzeSyntaxResponse\"O\202\323\344\223\002%\" /v1" + + "beta2/documents:analyzeSyntax:\001*\332A\026docum" + + "ent,encoding_type\332A\010document\022\256\001\n\014Classif" + + "yText\0222.google.cloud.language.v1beta2.Cl" + + "assifyTextRequest\0323.google.cloud.languag" + + "e.v1beta2.ClassifyTextResponse\"5\202\323\344\223\002$\"\037" + + "/v1beta2/documents:classifyText:\001*\332A\010doc" + + "ument\022\331\001\n\014AnnotateText\0222.google.cloud.la" + + "nguage.v1beta2.AnnotateTextRequest\0323.goo" + + "gle.cloud.language.v1beta2.AnnotateTextR" + + "esponse\"`\202\323\344\223\002$\"\037/v1beta2/documents:anno" + + "tateText:\001*\332A\037document,features,encoding" + + "_type\332A\021document,features\032z\312A\027language.g" + + "oogleapis.com\322A]https://www.googleapis.c" + + "om/auth/cloud-language,https://www.googl" + + "eapis.com/auth/cloud-platformB\202\001\n!com.go" + + "ogle.cloud.language.v1beta2B\024LanguageSer" + + "viceProtoP\001ZEgoogle.golang.org/genproto/" + + "googleapis/cloud/language/v1beta2;langua" + + "geb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -363,7 +397,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_Document_descriptor, new java.lang.String[] { - "Type", "Content", "GcsContentUri", "Language", "Source", + "Type", + "Content", + "GcsContentUri", + "Language", + "ReferenceWebUri", + "BoilerplateHandling", + "Source", }); internal_static_google_cloud_language_v1beta2_Sentence_descriptor = getDescriptor().getMessageTypes().get(1); @@ -456,8 +496,34 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "Confidence", }); - internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor = + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor, + new java.lang.String[] { + "V1Model", "V2Model", "ModelType", + }); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor = + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor = + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor, + new java.lang.String[] { + "ContentCategoriesVersion", + }); + internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor = + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor, @@ -465,7 +531,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_descriptor, @@ -473,7 +539,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DocumentSentiment", "Language", "Sentences", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_descriptor, @@ -481,7 +547,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_descriptor, @@ -489,7 +555,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_descriptor, @@ -497,7 +563,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_descriptor, @@ -505,7 +571,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_descriptor, @@ -513,7 +579,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_descriptor, @@ -521,15 +587,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Sentences", "Tokens", "Language", }); internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_descriptor, new java.lang.String[] { - "Document", + "Document", "ClassificationModelOptions", }); internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_descriptor, @@ -537,7 +603,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Categories", }); internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_descriptor, @@ -557,9 +623,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExtractDocumentSentiment", "ExtractEntitySentiment", "ClassifyText", + "ClassificationModelOptions", }); internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_descriptor, diff --git a/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto b/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto index 7d77376e..fd51d486 100644 --- a/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto +++ b/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -68,7 +67,7 @@ service LanguageService { } // Analyzes the syntax of the text and provides sentence boundaries and - // tokenization along with part-of-speech tags, dependency trees, and other + // tokenization along with part of speech tags, dependency trees, and other // properties. rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) { option (google.api.http) = { @@ -100,7 +99,7 @@ service LanguageService { } } - +// ################################################################ # // // Represents the input to API methods. message Document { @@ -116,6 +115,19 @@ message Document { HTML = 2; } + // Ways of handling boilerplate detected in the document + enum BoilerplateHandling { + // The boilerplate handling is not specified. + BOILERPLATE_HANDLING_UNSPECIFIED = 0; + + // Do not analyze detected boilerplate. Reference web URI is required for + // detecting boilerplate. + SKIP_BOILERPLATE = 1; + + // Treat boilerplate the same as content. + KEEP_BOILERPLATE = 2; + } + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, // returns an `INVALID_ARGUMENT` error. Type type = 1; @@ -143,6 +155,15 @@ message Document { // specified by the caller or automatically detected) is not supported by the // called API method, an `INVALID_ARGUMENT` error is returned. string language = 4; + + // The web URI where the document comes from. This URI is not used for + // fetching the content, but as a hint for analyzing the document. + string reference_web_uri = 5; + + // Indicates how detected boilerplate(e.g. advertisements, copyright + // declarations, banners) should be handled for this document. If not + // specified, boilerplate will be treated the same as content. + BoilerplateHandling boilerplate_handling = 6; } // Represents a sentence in the input document. @@ -156,6 +177,32 @@ message Sentence { Sentiment sentiment = 2; } +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +enum EncodingType { + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + NONE = 0; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + UTF8 = 1; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and JavaScript are examples of + // languages that use this encoding natively. + UTF16 = 2; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + UTF32 = 3; +} + // Represents a phrase in the text that is a known entity, such as // a person, an organization, or location. The API associates information, such // as salience and mentions, with entities. @@ -286,32 +333,6 @@ message Token { string lemma = 4; } -// Represents the text encoding that the caller uses to process the output. -// Providing an `EncodingType` is recommended because the API provides the -// beginning offsets for various outputs, such as tokens and mentions, and -// languages that natively use different text encodings may access offsets -// differently. -enum EncodingType { - // If `EncodingType` is not specified, encoding-dependent information (such as - // `begin_offset`) will be set at `-1`. - NONE = 0; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-8 encoding of the input. C++ and Go are examples of languages - // that use this encoding natively. - UTF8 = 1; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-16 encoding of the input. Java and JavaScript are examples of - // languages that use this encoding natively. - UTF16 = 2; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-32 encoding of the input. Python is an example of a language - // that uses this encoding natively. - UTF32 = 3; -} - // Represents the feeling associated with the entire text or entities in // the text. // Next ID: 6 @@ -968,6 +989,45 @@ message ClassificationCategory { float confidence = 2; } +// Model options available for classification requests. +message ClassificationModelOptions { + // Options for the V1 model. + message V1Model { + + } + + // Options for the V2 model. + message V2Model { + // The content categories used for classification. + enum ContentCategoriesVersion { + // If `ContentCategoriesVersion` is not specified, this option will + // default to `V1`. + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + + // Legacy content categories of our initial launch in 2017. + V1 = 1; + + // Updated content categories in 2022. + V2 = 2; + } + + // The content categories used for classification. + ContentCategoriesVersion content_categories_version = 1; + } + + // If this field is not set, then the `v1_model` will be used by default. + oneof model_type { + // Setting this field will use the V1 model and V1 content categories + // version. The V1 model is a legacy model; support for this will be + // discontinued in the future. + V1Model v1_model = 1; + + // Setting this field will use the V2 model with the appropriate content + // categories version. The V2 model is a better performing model. + V2Model v2_model = 2; + } +} + // The sentiment analysis request message. message AnalyzeSentimentRequest { // Required. Input document. @@ -1059,6 +1119,10 @@ message AnalyzeSyntaxResponse { message ClassifyTextRequest { // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Model options to use for classification. Defaults to v1 options if not + // specified. + ClassificationModelOptions classification_model_options = 3; } // The document classification response message. @@ -1072,7 +1136,7 @@ message ClassifyTextResponse { message AnnotateTextRequest { // All available features for sentiment, syntax, and semantic analysis. // Setting each one to true will enable that specific analysis for the input. - // Next ID: 10 + // Next ID: 11 message Features { // Extract syntax information. bool extract_syntax = 1; @@ -1091,6 +1155,10 @@ message AnnotateTextRequest { // [predefined // taxonomy](https://cloud.google.com/natural-language/docs/categories). bool classify_text = 6; + + // The model options to use for classification. Defaults to v1 options + // if not specified. Only used if `classify_text` is set to true. + ClassificationModelOptions classification_model_options = 10; } // Required. Input document. diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java index def8f6a5..5d351f77 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java @@ -18,6 +18,7 @@ // [START language_v1_generated_languageserviceclient_classifytext_async] import com.google.api.core.ApiFuture; +import com.google.cloud.language.v1.ClassificationModelOptions; import com.google.cloud.language.v1.ClassifyTextRequest; import com.google.cloud.language.v1.ClassifyTextResponse; import com.google.cloud.language.v1.Document; @@ -37,7 +38,10 @@ public static void asyncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ApiFuture future = languageServiceClient.classifyTextCallable().futureCall(request); // Do something. diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java index 5e68d26b..b319f8a6 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java @@ -17,6 +17,7 @@ package com.google.cloud.language.v1.samples; // [START language_v1_generated_languageserviceclient_classifytext_sync] +import com.google.cloud.language.v1.ClassificationModelOptions; import com.google.cloud.language.v1.ClassifyTextRequest; import com.google.cloud.language.v1.ClassifyTextResponse; import com.google.cloud.language.v1.Document; @@ -36,7 +37,10 @@ public static void syncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ClassifyTextResponse response = languageServiceClient.classifyText(request); } } diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java index ab9f2a1f..7eeee4a8 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java @@ -18,6 +18,7 @@ // [START language_v1beta2_generated_languageserviceclient_classifytext_async] import com.google.api.core.ApiFuture; +import com.google.cloud.language.v1beta2.ClassificationModelOptions; import com.google.cloud.language.v1beta2.ClassifyTextRequest; import com.google.cloud.language.v1beta2.ClassifyTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -37,7 +38,10 @@ public static void asyncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ApiFuture future = languageServiceClient.classifyTextCallable().futureCall(request); // Do something. diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java index 11f02cd0..9d74f92b 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java @@ -17,6 +17,7 @@ package com.google.cloud.language.v1beta2.samples; // [START language_v1beta2_generated_languageserviceclient_classifytext_sync] +import com.google.cloud.language.v1beta2.ClassificationModelOptions; import com.google.cloud.language.v1beta2.ClassifyTextRequest; import com.google.cloud.language.v1beta2.ClassifyTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -36,7 +37,10 @@ public static void syncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ClassifyTextResponse response = languageServiceClient.classifyText(request); } } From 6267be81ff610ef7c0c35320b032260c8b8d5db7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:30:31 +0000 Subject: [PATCH 13/43] docs: fix docstring formatting (#897) - [ ] Regenerate this pull request now. Committer: @parthea PiperOrigin-RevId: 476410563 Source-Link: https://github.com/googleapis/googleapis/commit/7f579ee5968051f12c86a2ea50bcdeb1fbd5df94 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae0240e097a196c070e15deaae66464b42c8e014 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWUwMjQwZTA5N2ExOTZjMDcwZTE1ZGVhYWU2NjQ2NGI0MmM4ZTAxNCJ9 --- .../language/v1/LanguageServiceGrpc.java | 24 +++---- .../language/v1/AnalyzeEntitiesResponse.java | 21 ++---- .../v1/AnalyzeEntitiesResponseOrBuilder.java | 6 +- .../v1/AnalyzeEntitySentimentResponse.java | 21 ++---- ...alyzeEntitySentimentResponseOrBuilder.java | 6 +- .../language/v1/AnalyzeSentimentResponse.java | 21 ++---- .../v1/AnalyzeSentimentResponseOrBuilder.java | 6 +- .../language/v1/AnalyzeSyntaxResponse.java | 21 ++---- .../v1/AnalyzeSyntaxResponseOrBuilder.java | 6 +- .../language/v1/AnnotateTextResponse.java | 21 ++---- .../v1/AnnotateTextResponseOrBuilder.java | 6 +- .../google/cloud/language/v1/Document.java | 2 - .../com/google/cloud/language/v1/Entity.java | 72 +++++++++---------- .../cloud/language/v1/EntityMention.java | 72 +++++++++---------- .../language/v1/EntityMentionOrBuilder.java | 18 ++--- .../cloud/language/v1/EntityOrBuilder.java | 18 ++--- .../google/cloud/language/v1/Sentence.java | 48 ++++++------- .../cloud/language/v1/SentenceOrBuilder.java | 12 ++-- .../google/cloud/language/v1/TextSpan.java | 16 ++--- .../cloud/language/v1/TextSpanOrBuilder.java | 4 +- .../cloud/language/v1/language_service.proto | 58 ++++++--------- .../cloud/language/v1beta2/Document.java | 2 - .../language/v1beta2/language_service.proto | 2 - 23 files changed, 201 insertions(+), 282 deletions(-) diff --git a/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java b/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java index e3f745e6..bf571966 100644 --- a/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java +++ b/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java @@ -408,10 +408,8 @@ public void analyzeEntities( * * *
-     * Finds entities, similar to
-     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
-     * in the text and analyzes sentiment associated with each entity and its
-     * mentions.
+     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
+     * sentiment associated with each entity and its mentions.
      * 
*/ public void analyzeEntitySentiment( @@ -578,10 +576,8 @@ public void analyzeEntities( * * *
-     * Finds entities, similar to
-     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
-     * in the text and analyzes sentiment associated with each entity and its
-     * mentions.
+     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
+     * sentiment associated with each entity and its mentions.
      * 
*/ public void analyzeEntitySentiment( @@ -701,10 +697,8 @@ public com.google.cloud.language.v1.AnalyzeEntitiesResponse analyzeEntities( * * *
-     * Finds entities, similar to
-     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
-     * in the text and analyzes sentiment associated with each entity and its
-     * mentions.
+     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
+     * sentiment associated with each entity and its mentions.
      * 
*/ public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse analyzeEntitySentiment( @@ -810,10 +804,8 @@ protected LanguageServiceFutureStub build( * * *
-     * Finds entities, similar to
-     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
-     * in the text and analyzes sentiment associated with each entity and its
-     * mentions.
+     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
+     * sentiment associated with each entity and its mentions.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java index 23f750d8..accd0b3e 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java @@ -206,8 +206,7 @@ public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int ind *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -232,8 +231,7 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -984,8 +982,7 @@ public java.util.List getEntitiesBu *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1009,8 +1006,7 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1034,8 +1030,7 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1058,8 +1053,7 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1078,8 +1072,7 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java index 4a920281..62bb035b 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java @@ -80,8 +80,7 @@ public interface AnalyzeEntitiesResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -95,8 +94,7 @@ public interface AnalyzeEntitiesResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java index 2307898c..905425e5 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java @@ -207,8 +207,7 @@ public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int ind *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -233,8 +232,7 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -986,8 +984,7 @@ public java.util.List getEntitiesBu *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1011,8 +1008,7 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1036,8 +1032,7 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1060,8 +1055,7 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1080,8 +1074,7 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java index 885d156b..16ee973a 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java @@ -80,8 +80,7 @@ public interface AnalyzeEntitySentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -95,8 +94,7 @@ public interface AnalyzeEntitySentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java index c5571518..49f6247c 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java @@ -201,8 +201,7 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -227,8 +226,7 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -915,8 +913,7 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -940,8 +937,7 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -965,8 +961,7 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -989,8 +984,7 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; @@ -1009,8 +1003,7 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java index 78f94d9b..9fa9e608 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java @@ -64,8 +64,7 @@ public interface AnalyzeSentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; @@ -79,8 +78,7 @@ public interface AnalyzeSentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java index 214cca7e..0288ed59 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java @@ -290,8 +290,7 @@ public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 3; @@ -316,8 +315,7 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 3; @@ -1470,8 +1468,7 @@ public java.util.List getTokensBuild *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 3; @@ -1495,8 +1492,7 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 3; @@ -1520,8 +1516,7 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 3; @@ -1544,8 +1539,7 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 3; @@ -1564,8 +1558,7 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java index 4a950561..1369f367 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java @@ -132,8 +132,7 @@ public interface AnalyzeSyntaxResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 3; @@ -147,8 +146,7 @@ public interface AnalyzeSyntaxResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java index e7471838..56f2bb54 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java @@ -483,8 +483,7 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 5; @@ -509,8 +508,7 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 5; @@ -2502,8 +2500,7 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 5; @@ -2527,8 +2524,7 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 5; @@ -2552,8 +2548,7 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 5; @@ -2576,8 +2571,7 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 5; @@ -2596,8 +2590,7 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field
-     * for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
      * 
* * string language = 5; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java index 922f5b1f..42ca1b94 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java @@ -246,8 +246,7 @@ public interface AnnotateTextResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 5; @@ -261,8 +260,7 @@ public interface AnnotateTextResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field
-   * for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
    * 
* * string language = 5; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java index 76a2d96c..b2b98e09 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java @@ -22,7 +22,6 @@ * * *
- * ################################################################ #
  * Represents the input to API methods.
  * 
* @@ -798,7 +797,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * ################################################################ #
    * Represents the input to API methods.
    * 
* diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java index c6991d69..19b1912b 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java @@ -917,9 +917,9 @@ public com.google.cloud.language.v1.EntityMentionOrBuilder getMentionsOrBuilder( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the aggregate sentiment expressed
-   * for this entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the aggregate sentiment expressed for this
+   * entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -935,9 +935,9 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the aggregate sentiment expressed
-   * for this entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the aggregate sentiment expressed for this
+   * entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -955,9 +955,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the aggregate sentiment expressed
-   * for this entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the aggregate sentiment expressed for this
+   * entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2259,9 +2259,9 @@ public com.google.cloud.language.v1.EntityMention.Builder addMentionsBuilder(int * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2276,9 +2276,9 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2299,9 +2299,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2324,9 +2324,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2346,9 +2346,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2375,9 +2375,9 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2398,9 +2398,9 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2415,9 +2415,9 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2436,9 +2436,9 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the aggregate sentiment expressed
-     * for this entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the aggregate sentiment expressed for this
+     * entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java index d0f1d55c..e176c4ba 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java @@ -392,9 +392,9 @@ public com.google.cloud.language.v1.EntityMention.Type getType() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the sentiment expressed for this
-   * mention of the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the sentiment expressed for this mention of
+   * the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -410,9 +410,9 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the sentiment expressed for this
-   * mention of the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the sentiment expressed for this mention of
+   * the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -430,9 +430,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the sentiment expressed for this
-   * mention of the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the sentiment expressed for this mention of
+   * the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1097,9 +1097,9 @@ public Builder clearType() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1114,9 +1114,9 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1137,9 +1137,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1162,9 +1162,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1184,9 +1184,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1213,9 +1213,9 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1236,9 +1236,9 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1253,9 +1253,9 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1274,9 +1274,9 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-     * is set to true, this field will contain the sentiment expressed for this
-     * mention of the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+     * true, this field will contain the sentiment expressed for this mention of
+     * the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java index 444002d5..b0c19f72 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java @@ -88,9 +88,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the sentiment expressed for this
-   * mention of the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the sentiment expressed for this mention of
+   * the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -103,9 +103,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the sentiment expressed for this
-   * mention of the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the sentiment expressed for this mention of
+   * the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -118,9 +118,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the sentiment expressed for this
-   * mention of the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the sentiment expressed for this mention of
+   * the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java index 326115d0..40475ed7 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java @@ -226,9 +226,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the aggregate sentiment expressed
-   * for this entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the aggregate sentiment expressed for this
+   * entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -241,9 +241,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the aggregate sentiment expressed
-   * for this entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the aggregate sentiment expressed for this
+   * entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -256,9 +256,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
-   * is set to true, this field will contain the aggregate sentiment expressed
-   * for this entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+   * true, this field will contain the aggregate sentiment expressed for this
+   * entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java index ff00a442..461cdeb7 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java @@ -189,8 +189,8 @@ public com.google.cloud.language.v1.TextSpanOrBuilder getTextOrBuilder() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-   * is set to true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+   * true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -206,8 +206,8 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-   * is set to true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+   * true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -225,8 +225,8 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-   * is set to true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+   * true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -782,8 +782,8 @@ public com.google.cloud.language.v1.TextSpanOrBuilder getTextOrBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -798,8 +798,8 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -820,8 +820,8 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -844,8 +844,8 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -865,8 +865,8 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -893,8 +893,8 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -915,8 +915,8 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -931,8 +931,8 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -951,8 +951,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-     * is set to true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+     * true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java index bf5fefcb..beaf0160 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java @@ -63,8 +63,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-   * is set to true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+   * true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -77,8 +77,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-   * is set to true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+   * true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -91,8 +91,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
-   * is set to true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
+   * true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java index 78b8aa14..8f4dd269 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java @@ -174,9 +174,7 @@ public com.google.protobuf.ByteString getContentBytes() { * *
    * The API calculates the beginning offset of the content in the original
-   * document according to the
-   * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
-   * request.
+   * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
    * 
* * int32 begin_offset = 2; @@ -629,9 +627,7 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the
-     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
-     * request.
+     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
      * 
* * int32 begin_offset = 2; @@ -647,9 +643,7 @@ public int getBeginOffset() { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the
-     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
-     * request.
+     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
      * 
* * int32 begin_offset = 2; @@ -668,9 +662,7 @@ public Builder setBeginOffset(int value) { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the
-     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
-     * request.
+     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
      * 
* * int32 begin_offset = 2; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java index 789ce7a8..6f39dd71 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java @@ -53,9 +53,7 @@ public interface TextSpanOrBuilder * *
    * The API calculates the beginning offset of the content in the original
-   * document according to the
-   * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
-   * request.
+   * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
    * 
* * int32 begin_offset = 2; diff --git a/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto b/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto index 06c68a27..4dae8974 100644 --- a/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto +++ b/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,8 +34,7 @@ service LanguageService { "https://www.googleapis.com/auth/cloud-platform"; // Analyzes the sentiment of the provided text. - rpc AnalyzeSentiment(AnalyzeSentimentRequest) - returns (AnalyzeSentimentResponse) { + rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) { option (google.api.http) = { post: "/v1/documents:analyzeSentiment" body: "*" @@ -47,8 +46,7 @@ service LanguageService { // Finds named entities (currently proper names and common nouns) in the text // along with entity types, salience, mentions for each entity, and // other properties. - rpc AnalyzeEntities(AnalyzeEntitiesRequest) - returns (AnalyzeEntitiesResponse) { + rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) { option (google.api.http) = { post: "/v1/documents:analyzeEntities" body: "*" @@ -57,12 +55,9 @@ service LanguageService { option (google.api.method_signature) = "document"; } - // Finds entities, similar to - // [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] - // in the text and analyzes sentiment associated with each entity and its - // mentions. - rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) - returns (AnalyzeEntitySentimentResponse) { + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) { option (google.api.http) = { post: "/v1/documents:analyzeEntitySentiment" body: "*" @@ -104,8 +99,6 @@ service LanguageService { } } -// ################################################################ # -// // Represents the input to API methods. message Document { // The document types enum. @@ -155,8 +148,8 @@ message Sentence { TextSpan text = 1; // For calls to [AnalyzeSentiment][] or if - // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] - // is set to true, this field will contain the sentiment for the sentence. + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to + // true, this field will contain the sentiment for the sentence. Sentiment sentiment = 2; } @@ -295,9 +288,9 @@ message Entity { repeated EntityMention mentions = 5; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] - // is set to true, this field will contain the aggregate sentiment expressed - // for this entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the aggregate sentiment expressed for this + // entity in the provided document. Sentiment sentiment = 6; } @@ -948,9 +941,9 @@ message EntityMention { Type type = 2; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] - // is set to true, this field will contain the sentiment expressed for this - // mention of the entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the sentiment expressed for this mention of + // the entity in the provided document. Sentiment sentiment = 3; } @@ -960,9 +953,7 @@ message TextSpan { string content = 1; // The API calculates the beginning offset of the content in the original - // document according to the - // [EncodingType][google.cloud.language.v1.EncodingType] specified in the API - // request. + // document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request. int32 begin_offset = 2; } @@ -980,7 +971,9 @@ message ClassificationCategory { // Model options available for classification requests. message ClassificationModelOptions { // Options for the V1 model. - message V1Model {} + message V1Model { + + } // Options for the V2 model. message V2Model { @@ -1030,8 +1023,7 @@ message AnalyzeSentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field - // for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. string language = 2; // The sentiment for all the sentences in the document. @@ -1054,8 +1046,7 @@ message AnalyzeEntitySentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field - // for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. string language = 2; } @@ -1075,8 +1066,7 @@ message AnalyzeEntitiesResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field - // for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. string language = 2; } @@ -1099,8 +1089,7 @@ message AnalyzeSyntaxResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field - // for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. string language = 3; } @@ -1178,8 +1167,7 @@ message AnnotateTextResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field - // for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. string language = 5; // Categories identified in the input document. diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java index ad769f87..84392173 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java @@ -22,7 +22,6 @@ * * *
- * ################################################################ #
  * Represents the input to API methods.
  * 
* @@ -1098,7 +1097,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * ################################################################ #
    * Represents the input to API methods.
    * 
* diff --git a/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto b/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto index fd51d486..3e6a9f82 100644 --- a/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto +++ b/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto @@ -99,8 +99,6 @@ service LanguageService { } } -// ################################################################ # -// // Represents the input to API methods. message Document { // The document types enum. From 87d32c8ee3da764149b65719fe8aa985f08a823e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:42:12 +0000 Subject: [PATCH 14/43] chore(main): release 2.4.0 (#896) :robot: I have created a release *beep* *boop* --- ## [2.4.0](https://github.com/googleapis/java-language/compare/v2.3.4...v2.4.0) (2022-09-26) ### Features * Add support for V1 and V2 classification models for the V1 API ([4148969](https://github.com/googleapis/java-language/commit/41489691955887daa9e00a365be6012ce4a57943)) * Add support for V1 and V2 classification models for the V1Beta2 API ([#895](https://github.com/googleapis/java-language/issues/895)) ([4148969](https://github.com/googleapis/java-language/commit/41489691955887daa9e00a365be6012ce4a57943)) ### Documentation * Fix docstring formatting ([#897](https://github.com/googleapis/java-language/issues/897)) ([6267be8](https://github.com/googleapis/java-language/commit/6267be81ff610ef7c0c35320b032260c8b8d5db7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 9 files changed, 40 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f99a7690..8a4ae36b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.4.0](https://github.com/googleapis/java-language/compare/v2.3.4...v2.4.0) (2022-09-26) + + +### Features + +* Add support for V1 and V2 classification models for the V1 API ([4148969](https://github.com/googleapis/java-language/commit/41489691955887daa9e00a365be6012ce4a57943)) +* Add support for V1 and V2 classification models for the V1Beta2 API ([#895](https://github.com/googleapis/java-language/issues/895)) ([4148969](https://github.com/googleapis/java-language/commit/41489691955887daa9e00a365be6012ce4a57943)) + + +### Documentation + +* Fix docstring formatting ([#897](https://github.com/googleapis/java-language/issues/897)) ([6267be8](https://github.com/googleapis/java-language/commit/6267be81ff610ef7c0c35320b032260c8b8d5db7)) + ## [2.3.4](https://github.com/googleapis/java-language/compare/v2.3.3...v2.3.4) (2022-09-15) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index b2bd2fcf..9a718e3e 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.3.5-SNAPSHOT + 2.4.0 pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.3.5-SNAPSHOT + 2.4.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.5-SNAPSHOT + 2.4.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.5-SNAPSHOT + 0.91.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.5-SNAPSHOT + 2.4.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.5-SNAPSHOT + 0.91.0 diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 95d8208b..93cd100a 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.3.5-SNAPSHOT + 2.4.0 jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.3.5-SNAPSHOT + 2.4.0 google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index c0152772..d07eb8e5 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.5-SNAPSHOT + 2.4.0 grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.5-SNAPSHOT + 2.4.0 diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index 7e27702c..375df085 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.5-SNAPSHOT + 0.91.0 grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.5-SNAPSHOT + 2.4.0 diff --git a/pom.xml b/pom.xml index 97838c31..cbf6bec7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.3.5-SNAPSHOT + 2.4.0 Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.3.5-SNAPSHOT + 2.4.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.5-SNAPSHOT + 0.91.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.3.5-SNAPSHOT + 2.4.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.90.5-SNAPSHOT + 0.91.0 com.google.cloud google-cloud-language - 2.3.5-SNAPSHOT + 2.4.0 diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index 60e180cc..f7980981 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.3.5-SNAPSHOT + 2.4.0 proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.3.5-SNAPSHOT + 2.4.0 diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index da25720b..899e53bc 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.90.5-SNAPSHOT + 0.91.0 proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.3.5-SNAPSHOT + 2.4.0 diff --git a/versions.txt b/versions.txt index 7e8deac3..d1149e7c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.3.4:2.3.5-SNAPSHOT -grpc-google-cloud-language-v1:2.3.4:2.3.5-SNAPSHOT -grpc-google-cloud-language-v1beta2:0.90.4:0.90.5-SNAPSHOT -proto-google-cloud-language-v1:2.3.4:2.3.5-SNAPSHOT -proto-google-cloud-language-v1beta2:0.90.4:0.90.5-SNAPSHOT +google-cloud-language:2.4.0:2.4.0 +grpc-google-cloud-language-v1:2.4.0:2.4.0 +grpc-google-cloud-language-v1beta2:0.91.0:0.91.0 +proto-google-cloud-language-v1:2.4.0:2.4.0 +proto-google-cloud-language-v1beta2:0.91.0:0.91.0 From a87e6596015fba5f84f0dfeed7379d4bc7b6f7de Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:11:21 -0400 Subject: [PATCH 15/43] chore(main): release 2.4.1-SNAPSHOT (#901) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index 9a718e3e..6eddb1e6 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.4.0 + 2.4.1-SNAPSHOT pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.4.0 + 2.4.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.0 + 2.4.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.0 + 0.91.1-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1 - 2.4.0 + 2.4.1-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.0 + 0.91.1-SNAPSHOT diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 93cd100a..602de9bd 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.4.0 + 2.4.1-SNAPSHOT jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.4.0 + 2.4.1-SNAPSHOT google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index d07eb8e5..5e45623d 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.0 + 2.4.1-SNAPSHOT grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index 375df085..cf8d2bdb 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.0 + 0.91.1-SNAPSHOT grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index cbf6bec7..ca381a59 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.4.0 + 2.4.1-SNAPSHOT Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.4.0 + 2.4.1-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.0 + 0.91.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.0 + 2.4.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.0 + 0.91.1-SNAPSHOT com.google.cloud google-cloud-language - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index f7980981..0a64c4ce 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.4.0 + 2.4.1-SNAPSHOT proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index 899e53bc..23d27738 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.0 + 0.91.1-SNAPSHOT proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index d1149e7c..43b1a439 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.4.0:2.4.0 -grpc-google-cloud-language-v1:2.4.0:2.4.0 -grpc-google-cloud-language-v1beta2:0.91.0:0.91.0 -proto-google-cloud-language-v1:2.4.0:2.4.0 -proto-google-cloud-language-v1beta2:0.91.0:0.91.0 +google-cloud-language:2.4.0:2.4.1-SNAPSHOT +grpc-google-cloud-language-v1:2.4.0:2.4.1-SNAPSHOT +grpc-google-cloud-language-v1beta2:0.91.0:0.91.1-SNAPSHOT +proto-google-cloud-language-v1:2.4.0:2.4.1-SNAPSHOT +proto-google-cloud-language-v1beta2:0.91.0:0.91.1-SNAPSHOT From 5a41ee47a13eb0b4ce2a20137205572c965cb8e7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 21:54:13 +0000 Subject: [PATCH 16/43] chore: exclude requirements.txt file from renovate-bot (#1594) (#902) Source-Link: https://github.com/googleapis/synthtool/commit/f58d3135a2fab20e225d98741dbc06d57459b816 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release/publish_javadoc.sh | 2 +- .kokoro/release/publish_javadoc11.sh | 2 +- .kokoro/release/stage.sh | 3 +- .kokoro/requirements.in | 31 ++ .kokoro/requirements.txt | 452 +++++++++++++++++++++++++++ README.md | 4 +- renovate.json | 1 + 8 files changed, 491 insertions(+), 6 deletions(-) create mode 100644 .kokoro/requirements.in create mode 100644 .kokoro/requirements.txt diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 62592923..42327db5 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93 + digest: sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 8d727a6e..c82ad4b7 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -28,7 +28,7 @@ fi pushd $(dirname "$0")/../../ # install docuploader package -python3 -m pip install gcp-docuploader +python3 -m pip install --require-hashes -r .kokoro/requirements.txt # compile all packages mvn clean install -B -q -DskipTests=true diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index aa7d51c4..2e830792 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -28,7 +28,7 @@ fi pushd $(dirname "$0")/../../ # install docuploader package -python3 -m pip install gcp-docuploader +python3 -m pip install --require-hashes -r .kokoro/requirements.txt # compile all packages mvn clean install -B -q -DskipTests=true diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 1dba8de1..61e714d6 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -16,7 +16,8 @@ set -eo pipefail # Start the releasetool reporter -python3 -m pip install gcp-releasetool +requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) +python3 -m pip install --require-hashes -r $requirementsFile python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script source $(dirname "$0")/common.sh diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in new file mode 100644 index 00000000..cfdc2e7e --- /dev/null +++ b/.kokoro/requirements.in @@ -0,0 +1,31 @@ +gcp-docuploader==0.6.3 +google-crc32c==1.3.0 +googleapis-common-protos==1.56.3 +gcp-releasetool==1.8.7 +cachetools==4.2.4 +cffi==1.15.1 +jeepney==0.7.1 +jinja2==3.0.3 +markupsafe==2.0.1 +keyring==23.4.1 +packaging==21.3 +protobuf==3.19.5 +pyjwt==2.4.0 +pyparsing==3.0.9 +pycparser==2.21 +pyperclip==1.8.2 +python-dateutil==2.8.2 +requests==2.27.1 +importlib-metadata==4.8.3 +zipp==3.6.0 +google_api_core==2.8.2 +google-cloud-storage==2.0.0 +google-cloud-core==2.3.1 +typing-extensions==4.1.1 +urllib3==1.26.12 +zipp==3.6.0 +rsa==4.9 +six==1.16.0 +attrs==22.1.0 +google-auth==2.11.0 +idna==3.4 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt new file mode 100644 index 00000000..170f1c63 --- /dev/null +++ b/.kokoro/requirements.txt @@ -0,0 +1,452 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile --allow-unsafe --generate-hashes requirements.in +# +attrs==22.1.0 \ + --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ + --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c + # via + # -r requirements.in + # gcp-releasetool +cachetools==4.2.4 \ + --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ + --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 + # via + # -r requirements.in + # google-auth +certifi==2022.9.14 \ + --hash=sha256:36973885b9542e6bd01dea287b2b4b3b21236307c56324fcc3f1160f2d655ed5 \ + --hash=sha256:e232343de1ab72c2aa521b625c80f699e356830fd0e2c620b465b304b17b0516 + # via requests +cffi==1.15.1 \ + --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ + --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ + --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ + --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ + --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ + --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ + --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ + --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ + --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ + --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ + --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ + --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ + --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ + --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ + --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ + --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ + --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ + --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ + --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ + --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ + --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ + --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ + --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ + --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ + --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ + --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ + --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ + --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ + --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ + --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ + --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ + --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ + --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ + --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ + --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ + --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ + --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ + --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ + --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ + --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ + --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ + --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ + --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ + --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ + --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ + --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ + --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ + --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ + --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ + --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ + --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ + --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ + --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ + --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ + --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ + --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ + --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ + --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ + --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ + --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ + --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ + --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ + --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ + --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 + # via + # -r requirements.in + # cryptography +charset-normalizer==2.0.12 \ + --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ + --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df + # via requests +click==8.0.4 \ + --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ + --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb + # via + # gcp-docuploader + # gcp-releasetool +colorlog==6.7.0 \ + --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ + --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 + # via gcp-docuploader +cryptography==38.0.1 \ + --hash=sha256:0297ffc478bdd237f5ca3a7dc96fc0d315670bfa099c04dc3a4a2172008a405a \ + --hash=sha256:10d1f29d6292fc95acb597bacefd5b9e812099d75a6469004fd38ba5471a977f \ + --hash=sha256:16fa61e7481f4b77ef53991075de29fc5bacb582a1244046d2e8b4bb72ef66d0 \ + --hash=sha256:194044c6b89a2f9f169df475cc167f6157eb9151cc69af8a2a163481d45cc407 \ + --hash=sha256:1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7 \ + --hash=sha256:3261725c0ef84e7592597606f6583385fed2a5ec3909f43bc475ade9729a41d6 \ + --hash=sha256:3b72c360427889b40f36dc214630e688c2fe03e16c162ef0aa41da7ab1455153 \ + --hash=sha256:3e3a2599e640927089f932295a9a247fc40a5bdf69b0484532f530471a382750 \ + --hash=sha256:3fc26e22840b77326a764ceb5f02ca2d342305fba08f002a8c1f139540cdfaad \ + --hash=sha256:5067ee7f2bce36b11d0e334abcd1ccf8c541fc0bbdaf57cdd511fdee53e879b6 \ + --hash=sha256:52e7bee800ec869b4031093875279f1ff2ed12c1e2f74923e8f49c916afd1d3b \ + --hash=sha256:64760ba5331e3f1794d0bcaabc0d0c39e8c60bf67d09c93dc0e54189dfd7cfe5 \ + --hash=sha256:765fa194a0f3372d83005ab83ab35d7c5526c4e22951e46059b8ac678b44fa5a \ + --hash=sha256:79473cf8a5cbc471979bd9378c9f425384980fcf2ab6534b18ed7d0d9843987d \ + --hash=sha256:896dd3a66959d3a5ddcfc140a53391f69ff1e8f25d93f0e2e7830c6de90ceb9d \ + --hash=sha256:89ed49784ba88c221756ff4d4755dbc03b3c8d2c5103f6d6b4f83a0fb1e85294 \ + --hash=sha256:ac7e48f7e7261207d750fa7e55eac2d45f720027d5703cd9007e9b37bbb59ac0 \ + --hash=sha256:ad7353f6ddf285aeadfaf79e5a6829110106ff8189391704c1d8801aa0bae45a \ + --hash=sha256:b0163a849b6f315bf52815e238bc2b2346604413fa7c1601eea84bcddb5fb9ac \ + --hash=sha256:b6c9b706316d7b5a137c35e14f4103e2115b088c412140fdbd5f87c73284df61 \ + --hash=sha256:c2e5856248a416767322c8668ef1845ad46ee62629266f84a8f007a317141013 \ + --hash=sha256:ca9f6784ea96b55ff41708b92c3f6aeaebde4c560308e5fbbd3173fbc466e94e \ + --hash=sha256:d1a5bd52d684e49a36582193e0b89ff267704cd4025abefb9e26803adeb3e5fb \ + --hash=sha256:d3971e2749a723e9084dd507584e2a2761f78ad2c638aa31e80bc7a15c9db4f9 \ + --hash=sha256:d4ef6cc305394ed669d4d9eebf10d3a101059bdcf2669c366ec1d14e4fb227bd \ + --hash=sha256:d9e69ae01f99abe6ad646947bba8941e896cb3aa805be2597a0400e0764b5818 + # via + # gcp-releasetool + # secretstorage +gcp-docuploader==0.6.3 \ + --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ + --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b + # via -r requirements.in +gcp-releasetool==1.8.7 \ + --hash=sha256:3d2a67c9db39322194afb3b427e9cb0476ce8f2a04033695f0aeb63979fc2b37 \ + --hash=sha256:5e4d28f66e90780d77f3ecf1e9155852b0c3b13cbccb08ab07e66b2357c8da8d + # via -r requirements.in +google-api-core==2.8.2 \ + --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ + --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 + # via + # -r requirements.in + # google-cloud-core + # google-cloud-storage +google-auth==2.11.0 \ + --hash=sha256:be62acaae38d0049c21ca90f27a23847245c9f161ff54ede13af2cb6afecbac9 \ + --hash=sha256:ed65ecf9f681832298e29328e1ef0a3676e3732b2e56f41532d45f70a22de0fb + # via + # -r requirements.in + # gcp-releasetool + # google-api-core + # google-cloud-core + # google-cloud-storage +google-cloud-core==2.3.1 \ + --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ + --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 + # via + # -r requirements.in + # google-cloud-storage +google-cloud-storage==2.0.0 \ + --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ + --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 + # via + # -r requirements.in + # gcp-docuploader +google-crc32c==1.3.0 \ + --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ + --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ + --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ + --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ + --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ + --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ + --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ + --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ + --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ + --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ + --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ + --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ + --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ + --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ + --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ + --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ + --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ + --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ + --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ + --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ + --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ + --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ + --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ + --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ + --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ + --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ + --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ + --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ + --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ + --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ + --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ + --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ + --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ + --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ + --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ + --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ + --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ + --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ + --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ + --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ + --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ + --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ + --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 + # via + # -r requirements.in + # google-resumable-media +google-resumable-media==2.3.3 \ + --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ + --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 + # via google-cloud-storage +googleapis-common-protos==1.56.3 \ + --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ + --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 + # via + # -r requirements.in + # google-api-core +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 + # via + # -r requirements.in + # requests +importlib-metadata==4.8.3 \ + --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ + --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 + # via + # -r requirements.in + # keyring +jeepney==0.7.1 \ + --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ + --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f + # via + # -r requirements.in + # keyring + # secretstorage +jinja2==3.0.3 \ + --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ + --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 + # via + # -r requirements.in + # gcp-releasetool +keyring==23.4.1 \ + --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ + --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 + # via + # -r requirements.in + # gcp-releasetool +markupsafe==2.0.1 \ + --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ + --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ + --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ + --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ + --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ + --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ + --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ + --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ + --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ + --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ + --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ + --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ + --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ + --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ + --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ + --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ + --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ + --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ + --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ + --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ + --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ + --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ + --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ + --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ + --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ + --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ + --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ + --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ + --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ + --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ + --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ + --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ + --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ + --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ + --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ + --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ + --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ + --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ + --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ + --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ + --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ + --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ + --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ + --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ + --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ + --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ + --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ + --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ + --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ + --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ + --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ + --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ + --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ + --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ + --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ + --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ + --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ + --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ + --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ + --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ + --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ + --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ + --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ + --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ + --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ + --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ + --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ + --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ + --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 + # via + # -r requirements.in + # jinja2 +packaging==21.3 \ + --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ + --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 + # via + # -r requirements.in + # gcp-releasetool +protobuf==3.19.5 \ + --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ + --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ + --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ + --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ + --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ + --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ + --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ + --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ + --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ + --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ + --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ + --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ + --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ + --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ + --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ + --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ + --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ + --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ + --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ + --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ + --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ + --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ + --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ + --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ + --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ + --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de + # via + # -r requirements.in + # gcp-docuploader + # gcp-releasetool + # google-api-core + # google-cloud-storage + # googleapis-common-protos +pyasn1==0.4.8 \ + --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ + --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba + # via + # pyasn1-modules + # rsa +pyasn1-modules==0.2.8 \ + --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ + --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 + # via google-auth +pycparser==2.21 \ + --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ + --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 + # via + # -r requirements.in + # cffi +pyjwt==2.4.0 \ + --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ + --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba + # via + # -r requirements.in + # gcp-releasetool +pyparsing==3.0.9 \ + --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ + --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc + # via + # -r requirements.in + # packaging +pyperclip==1.8.2 \ + --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 + # via + # -r requirements.in + # gcp-releasetool +python-dateutil==2.8.2 \ + --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ + --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 + # via + # -r requirements.in + # gcp-releasetool +requests==2.27.1 \ + --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ + --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d + # via + # -r requirements.in + # gcp-releasetool + # google-api-core + # google-cloud-storage +rsa==4.9 \ + --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ + --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 + # via + # -r requirements.in + # google-auth +secretstorage==3.3.3 \ + --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ + --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 + # via keyring +six==1.16.0 \ + --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ + --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 + # via + # -r requirements.in + # gcp-docuploader + # google-auth + # python-dateutil +typing-extensions==4.1.1 \ + --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ + --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 + # via -r requirements.in +urllib3==1.26.12 \ + --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ + --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 + # via + # -r requirements.in + # requests +zipp==3.6.0 \ + --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ + --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc + # via + # -r requirements.in + # importlib-metadata diff --git a/README.md b/README.md index 96983a24..dede7d79 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-language' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.3.4' +implementation 'com.google.cloud:google-cloud-language:2.4.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.4" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.4.0" ``` ## Authentication diff --git a/renovate.json b/renovate.json index 3a3c56f1..39515cf3 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], + "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ From 7b3a5f86b7de401198e74e76ba7af1f1599ae6cc Mon Sep 17 00:00:00 2001 From: wizeng23 Date: Tue, 27 Sep 2022 13:02:38 -0700 Subject: [PATCH 17/43] docs: update classification sample to use v2 model (#899) --- .../java/com/example/language/Analyze.java | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/language/Analyze.java b/samples/snippets/src/main/java/com/example/language/Analyze.java index 25ca4131..04aaef4a 100644 --- a/samples/snippets/src/main/java/com/example/language/Analyze.java +++ b/samples/snippets/src/main/java/com/example/language/Analyze.java @@ -24,6 +24,9 @@ import com.google.cloud.language.v1.AnalyzeSyntaxRequest; import com.google.cloud.language.v1.AnalyzeSyntaxResponse; import com.google.cloud.language.v1.ClassificationCategory; +import com.google.cloud.language.v1.ClassificationModelOptions; +import com.google.cloud.language.v1.ClassificationModelOptions.V2Model; +import com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion; import com.google.cloud.language.v1.ClassifyTextRequest; import com.google.cloud.language.v1.ClassifyTextResponse; import com.google.cloud.language.v1.Document; @@ -124,7 +127,7 @@ public static void analyzeEntitiesFile(String gcsUri) throws Exception { // [START language_entities_gcs] // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient try (LanguageServiceClient language = LanguageServiceClient.create()) { - // set the GCS Content URI path to the file to be analyzed + // Set the GCS Content URI path to the file to be analyzed Document doc = Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); AnalyzeEntitiesRequest request = @@ -203,9 +206,9 @@ public static List analyzeSyntaxText(String text) throws Exception { .setDocument(doc) .setEncodingType(EncodingType.UTF16) .build(); - // analyze the syntax in the given text + // Analyze the syntax in the given text AnalyzeSyntaxResponse response = language.analyzeSyntax(request); - // print the response + // Print the response for (Token token : response.getTokensList()) { System.out.printf("\tText: %s\n", token.getText().getContent()); System.out.printf("\tBeginOffset: %d\n", token.getText().getBeginOffset()); @@ -243,9 +246,9 @@ public static List analyzeSyntaxFile(String gcsUri) throws Exception { .setDocument(doc) .setEncodingType(EncodingType.UTF16) .build(); - // analyze the syntax in the given text + // Analyze the syntax in the given text AnalyzeSyntaxResponse response = language.analyzeSyntax(request); - // print the response + // Print the response for (Token token : response.getTokensList()) { System.out.printf("\tText: %s\n", token.getText().getContent()); System.out.printf("\tBeginOffset: %d\n", token.getText().getBeginOffset()); @@ -277,10 +280,17 @@ public static void classifyText(String text) throws Exception { // [START language_classify_text] // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient try (LanguageServiceClient language = LanguageServiceClient.create()) { - // set content to the text string + // Set content to the text string Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - ClassifyTextRequest request = ClassifyTextRequest.newBuilder().setDocument(doc).build(); - // detect categories in the given text + V2Model v2Model = V2Model.setContentCategoriesVersion(ContentCategoriesVersion.V2).build(); + ClassificationModelOptions options = + ClassificationModelOptions.newBuilder().setV2Model(v2Model).build(); + ClassifyTextRequest request = + ClassifyTextRequest.newBuilder() + .setDocument(doc) + .setClassificationModelOptions(options) + .build(); + // Detect categories in the given text ClassifyTextResponse response = language.classifyText(request); for (ClassificationCategory category : response.getCategoriesList()) { @@ -297,11 +307,11 @@ public static void classifyFile(String gcsUri) throws Exception { // [START language_classify_gcs] // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient try (LanguageServiceClient language = LanguageServiceClient.create()) { - // set the GCS content URI path + // Set the GCS content URI path Document doc = Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); ClassifyTextRequest request = ClassifyTextRequest.newBuilder().setDocument(doc).build(); - // detect categories in the given file + // Detect categories in the given file ClassifyTextResponse response = language.classifyText(request); for (ClassificationCategory category : response.getCategoriesList()) { @@ -324,7 +334,7 @@ public static void entitySentimentText(String text) throws Exception { .setDocument(doc) .setEncodingType(EncodingType.UTF16) .build(); - // detect entity sentiments in the given string + // Detect entity sentiments in the given string AnalyzeEntitySentimentResponse response = language.analyzeEntitySentiment(request); // Print the response for (Entity entity : response.getEntitiesList()) { @@ -343,7 +353,7 @@ public static void entitySentimentText(String text) throws Exception { // [END language_entity_sentiment_text] } - /** Identifies the entity sentiments in the the GCS hosted file using the Language Beta API. */ + /** Identifies the entity sentiments in the GCS hosted file using the Language Beta API. */ public static void entitySentimentFile(String gcsUri) throws Exception { // [START language_entity_sentiment_gcs] // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient From b9e8fbcf84d7ab7fb2b30e5d046e936aa1a6a060 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:46:37 -0400 Subject: [PATCH 18/43] chore: pin versions of dependencies for compatibility with Python 3.6 (#1588) (#900) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: pin versions of dependencies for compatibility with Python 3.6 (#1588) * chore: pin versions of dependencies for compatibility with Python 3.6 * fix path of requirements file in synthtool Source-Link: https://github.com/googleapis/synthtool/commit/69cdb47824170d0b02bf694649ce66613c889040 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:6566dc8226f20993af18e5a4e7a2b1ba85a292b02dedb6a1634cf10e1b418fa5 * πŸ¦‰ Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Diego Alonso Marquez Palacios --- .github/.OwlBot.lock.yaml | 3 ++- renovate.json | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 42327db5..0a5cae5a 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 + digest: sha256:6566dc8226f20993af18e5a4e7a2b1ba85a292b02dedb6a1634cf10e1b418fa5 + diff --git a/renovate.json b/renovate.json index 39515cf3..3a3c56f1 100644 --- a/renovate.json +++ b/renovate.json @@ -10,7 +10,6 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], - "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ From 240348fbf58906144675add557428e612104f898 Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Thu, 29 Sep 2022 18:00:39 -0400 Subject: [PATCH 19/43] Revert "chore: pin versions of dependencies for compatibility with Python 3.6 (#1588)" (#927) Reverts googleapis/java-language#900 --- .github/.OwlBot.lock.yaml | 3 +-- renovate.json | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 0a5cae5a..42327db5 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:6566dc8226f20993af18e5a4e7a2b1ba85a292b02dedb6a1634cf10e1b418fa5 - + digest: sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 diff --git a/renovate.json b/renovate.json index 3a3c56f1..39515cf3 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], + "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ From c34885ba6ad41c8eeeeda2ad9feb20f89f67e589 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 00:08:34 +0200 Subject: [PATCH 20/43] deps: update dependency google-cloud-storage to v2.5.0 (#923) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-storage](https://togithub.com/googleapis/python-storage) | `==2.0.0` -> `==2.5.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/compatibility-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/confidence-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). From 8b39a51acbc452afc2bb045f6d88bbdfc46b81ed Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 00:22:17 +0200 Subject: [PATCH 21/43] deps: update dependency google-api-core to v2.10.1 (#921) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-api-core](https://togithub.com/googleapis/python-api-core) | `==2.8.2` -> `==2.10.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/compatibility-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/confidence-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). From a246f0dcc43ce8faeefdf998011222df294d27fa Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 00:34:21 +0200 Subject: [PATCH 22/43] deps: update dependency importlib-metadata to v4.12.0 (#925) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [importlib-metadata](https://togithub.com/python/importlib_metadata) | `==4.8.3` -> `==4.12.0` | [![age](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/compatibility-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/confidence-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). From f273003a294fb2d116c78f25848bd22fa8f18fc8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 00:42:18 +0200 Subject: [PATCH 23/43] deps: update dependency google-auth to v2.12.0 (#922) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-auth](https://togithub.com/googleapis/google-auth-library-python) | `==2.11.0` -> `==2.12.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-auth/2.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-auth/2.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-auth/2.12.0/compatibility-slim/2.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-auth/2.12.0/confidence-slim/2.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). From 04a307ad130c3adfb2471aac551ebfc674c0d060 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 00:54:18 +0200 Subject: [PATCH 24/43] deps: update dependency jeepney to v0.8.0 (#926) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jeepney](https://gitlab.com/takluyver/jeepney) | `==0.7.1` -> `==0.8.0` | [![age](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/compatibility-slim/0.7.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/confidence-slim/0.7.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). From 51baceb6bf821f3da41569b27cd7cdf745bd1db8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 01:40:19 +0200 Subject: [PATCH 25/43] deps: update dependency google-crc32c to v1.5.0 (#924) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-crc32c](https://togithub.com/googleapis/python-crc32c) | `==1.3.0` -> `==1.5.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/compatibility-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/confidence-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). From 805563b083bb04bfa59ef7fc4418c6950b3340db Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 3 Oct 2022 15:36:25 +0200 Subject: [PATCH 26/43] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 (#929) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.3` -> `3.0.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.4/compatibility-slim/3.0.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.4/confidence-slim/3.0.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.4`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​304-httpsgithubcomgoogleapisjava-shared-dependenciescomparev303v304-2022-10-03) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.3...v3.0.4) ##### Dependencies - Update dependency cachetools to v5 ([#​816](https://togithub.com/googleapis/java-shared-dependencies/issues/816)) ([3f6c408](https://togithub.com/googleapis/java-shared-dependencies/commit/3f6c408210c931c286235f61c7aadea5bf5cfe4d)) - Update dependency certifi to v2022.9.24 ([#​818](https://togithub.com/googleapis/java-shared-dependencies/issues/818)) ([5f04b97](https://togithub.com/googleapis/java-shared-dependencies/commit/5f04b97c2343146600e8c9ee65afdeb58f5743a6)) - Update dependency charset-normalizer to v2.1.1 ([#​822](https://togithub.com/googleapis/java-shared-dependencies/issues/822)) ([6997c5a](https://togithub.com/googleapis/java-shared-dependencies/commit/6997c5acad937ebe3594330de73261a424d42cf3)) - Update dependency click to v8.1.3 ([#​823](https://togithub.com/googleapis/java-shared-dependencies/issues/823)) ([42bf9f8](https://togithub.com/googleapis/java-shared-dependencies/commit/42bf9f834fdafea60f2be7ccbf7d363e058cd7c2)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.7 ([#​837](https://togithub.com/googleapis/java-shared-dependencies/issues/837)) ([d31e507](https://togithub.com/googleapis/java-shared-dependencies/commit/d31e5077c7e036de5e238e9a611df7ced527574a)) - Update dependency gcp-releasetool to v1.8.8 ([#​819](https://togithub.com/googleapis/java-shared-dependencies/issues/819)) ([8245d97](https://togithub.com/googleapis/java-shared-dependencies/commit/8245d975fb12e81454ec7664f9a7c9809bbac697)) - Update dependency gcp-releasetool to v1.8.9 ([#​846](https://togithub.com/googleapis/java-shared-dependencies/issues/846)) ([04e3283](https://togithub.com/googleapis/java-shared-dependencies/commit/04e32831c6e87c372444901013a747d2d02ce38d)) - Update dependency google-api-core to v2.10.1 ([#​824](https://togithub.com/googleapis/java-shared-dependencies/issues/824)) ([818b9aa](https://togithub.com/googleapis/java-shared-dependencies/commit/818b9aa2ac99d8b1f9b39a74b626122aed5f1d94)) - Update dependency google-auth to v2.12.0 ([#​825](https://togithub.com/googleapis/java-shared-dependencies/issues/825)) ([07c544b](https://togithub.com/googleapis/java-shared-dependencies/commit/07c544b5e0fa9f7110bbc957570f7a405962072e)) - Update dependency google-cloud-core to v2.3.2 ([#​820](https://togithub.com/googleapis/java-shared-dependencies/issues/820)) ([2a219e8](https://togithub.com/googleapis/java-shared-dependencies/commit/2a219e86f187ba5ad72f2570bd58ca6100128c43)) - Update dependency google-cloud-storage to v2.5.0 ([#​826](https://togithub.com/googleapis/java-shared-dependencies/issues/826)) ([bb10d18](https://togithub.com/googleapis/java-shared-dependencies/commit/bb10d1858a515f09d365362ffa0110a5b362c96b)) - Update dependency google-crc32c to v1.5.0 ([#​827](https://togithub.com/googleapis/java-shared-dependencies/issues/827)) ([7e5dae6](https://togithub.com/googleapis/java-shared-dependencies/commit/7e5dae60d667cb84b9ee4f6c977bdc35e79e4cf6)) - Update dependency google-resumable-media to v2.4.0 ([#​838](https://togithub.com/googleapis/java-shared-dependencies/issues/838)) ([ad82d63](https://togithub.com/googleapis/java-shared-dependencies/commit/ad82d6378f64039da383509638fb4782908eb4bc)) - Update dependency googleapis-common-protos to v1.56.4 ([#​821](https://togithub.com/googleapis/java-shared-dependencies/issues/821)) ([93d7745](https://togithub.com/googleapis/java-shared-dependencies/commit/93d77458c9bbf84ec367cdb4caaa41e6f71675c6)) - Update dependency importlib-metadata to v4.12.0 ([#​832](https://togithub.com/googleapis/java-shared-dependencies/issues/832)) ([ee19fb1](https://togithub.com/googleapis/java-shared-dependencies/commit/ee19fb1ca5a2a2e1985297e3b72d44de68bc72e3)) - Update dependency importlib-metadata to v4.13.0 ([#​843](https://togithub.com/googleapis/java-shared-dependencies/issues/843)) ([d2ede60](https://togithub.com/googleapis/java-shared-dependencies/commit/d2ede601eee8c875780c7eb5924623537480c509)) - Update dependency importlib-metadata to v5 ([#​845](https://togithub.com/googleapis/java-shared-dependencies/issues/845)) ([03ac7e8](https://togithub.com/googleapis/java-shared-dependencies/commit/03ac7e800274c5f58d2bc4ddd0561bfcdea1bb27)) - Update dependency io.grpc:grpc-bom to v1.49.1 ([#​802](https://togithub.com/googleapis/java-shared-dependencies/issues/802)) ([b8c54bf](https://togithub.com/googleapis/java-shared-dependencies/commit/b8c54bf8f1ddecc788cee151f8afe42de45bdc9d)) - Update dependency io.grpc:grpc-bom to v1.49.2 ([#​842](https://togithub.com/googleapis/java-shared-dependencies/issues/842)) ([1b1cfa2](https://togithub.com/googleapis/java-shared-dependencies/commit/1b1cfa27d05f7732da12721305cf41dcbebda232)) - Update dependency jeepney to v0.8.0 ([#​833](https://togithub.com/googleapis/java-shared-dependencies/issues/833)) ([15d2f9f](https://togithub.com/googleapis/java-shared-dependencies/commit/15d2f9f52b5a3259db0813df3d2424e256ccb372)) - Update dependency jinja2 to v3.1.2 ([#​834](https://togithub.com/googleapis/java-shared-dependencies/issues/834)) ([c188f95](https://togithub.com/googleapis/java-shared-dependencies/commit/c188f95acdb3349f1c4b3ed56e5fffb75e8fbc8d)) - Update dependency keyring to v23.9.3 ([#​828](https://togithub.com/googleapis/java-shared-dependencies/issues/828)) ([b185aaa](https://togithub.com/googleapis/java-shared-dependencies/commit/b185aaae716d4d97cb64f0426cac0e778f11223d)) - Update dependency markupsafe to v2.1.1 ([#​829](https://togithub.com/googleapis/java-shared-dependencies/issues/829)) ([add2825](https://togithub.com/googleapis/java-shared-dependencies/commit/add2825bd34cd80f529dbe0dadb3c84219177916)) - Update dependency org.threeten:threetenbp to v1.6.2 ([#​808](https://togithub.com/googleapis/java-shared-dependencies/issues/808)) ([2d2eabd](https://togithub.com/googleapis/java-shared-dependencies/commit/2d2eabd14d8150207885ea47280c0f7ff3d2962f)) - Update dependency protobuf to v3.20.2 ([#​830](https://togithub.com/googleapis/java-shared-dependencies/issues/830)) ([5afa76f](https://togithub.com/googleapis/java-shared-dependencies/commit/5afa76f9ef4705aecba49abc7bb93982fb1ecf3e)) - Update dependency protobuf to v3.20.3 ([#​839](https://togithub.com/googleapis/java-shared-dependencies/issues/839)) ([d9fc7dd](https://togithub.com/googleapis/java-shared-dependencies/commit/d9fc7ddd3e663458e6ea3f78a3c6241377df0319)) - Update dependency protobuf to v4 ([#​817](https://togithub.com/googleapis/java-shared-dependencies/issues/817)) ([ee8d154](https://togithub.com/googleapis/java-shared-dependencies/commit/ee8d154287ccd256b4dcfa48f28f5ec61a91fe3e)) - Update dependency pyjwt to v2.5.0 ([#​812](https://togithub.com/googleapis/java-shared-dependencies/issues/812)) ([4d4528e](https://togithub.com/googleapis/java-shared-dependencies/commit/4d4528e8ce269d49b99d2dbc4fcda2dc37a058cb)) - Update dependency requests to v2.28.1 ([#​813](https://togithub.com/googleapis/java-shared-dependencies/issues/813)) ([a3a8d89](https://togithub.com/googleapis/java-shared-dependencies/commit/a3a8d89b0117007a7108553c70aa82dd289e1691)) - Update dependency typing-extensions to v4.3.0 ([#​814](https://togithub.com/googleapis/java-shared-dependencies/issues/814)) ([da875e5](https://togithub.com/googleapis/java-shared-dependencies/commit/da875e5e91fa9d8c177e6c3afc9e34242eb914b7)) - Update dependency zipp to v3.8.1 ([#​815](https://togithub.com/googleapis/java-shared-dependencies/issues/815)) ([15585fd](https://togithub.com/googleapis/java-shared-dependencies/commit/15585fd0216013fe93be011f93f391f6269aa777)) - Update gax.version to v2.19.2 ([#​847](https://togithub.com/googleapis/java-shared-dependencies/issues/847)) ([c4afe1f](https://togithub.com/googleapis/java-shared-dependencies/commit/c4afe1fdc88af29ab039cea618d52c15c90e43e9)) - Update google.common-protos.version to v2.9.3 ([#​803](https://togithub.com/googleapis/java-shared-dependencies/issues/803)) ([a3e8e5e](https://togithub.com/googleapis/java-shared-dependencies/commit/a3e8e5eb53a8da14abf3b8d81a4f34fbb2f3b8f9)) - Update google.common-protos.version to v2.9.5 ([#​831](https://togithub.com/googleapis/java-shared-dependencies/issues/831)) ([1c901db](https://togithub.com/googleapis/java-shared-dependencies/commit/1c901db8a7740afaec3e809e51d4d369fbf469c4)) - Update google.common-protos.version to v2.9.6 ([#​844](https://togithub.com/googleapis/java-shared-dependencies/issues/844)) ([9e156be](https://togithub.com/googleapis/java-shared-dependencies/commit/9e156be59bd89959f04252c3045b8cd7a8be8070)) - Update google.core.version to v2.8.13 ([#​804](https://togithub.com/googleapis/java-shared-dependencies/issues/804)) ([45ae571](https://togithub.com/googleapis/java-shared-dependencies/commit/45ae57142bd6d5334eedd46243736b200a459795)) - Update google.core.version to v2.8.14 ([#​805](https://togithub.com/googleapis/java-shared-dependencies/issues/805)) ([02c9397](https://togithub.com/googleapis/java-shared-dependencies/commit/02c9397a84bf3fcca8d04e4c9867cc47689abde2)) - Update google.core.version to v2.8.15 ([#​807](https://togithub.com/googleapis/java-shared-dependencies/issues/807)) ([980856c](https://togithub.com/googleapis/java-shared-dependencies/commit/980856c43981992a3d08f69eac83aeada752d244)) - Update google.core.version to v2.8.16 ([#​810](https://togithub.com/googleapis/java-shared-dependencies/issues/810)) ([c2b2c9a](https://togithub.com/googleapis/java-shared-dependencies/commit/c2b2c9a327fd588f69524bb93a17e5d4ae8f5a42)) - Update google.core.version to v2.8.17 ([#​835](https://togithub.com/googleapis/java-shared-dependencies/issues/835)) ([3def21d](https://togithub.com/googleapis/java-shared-dependencies/commit/3def21df2e4253e3df0da064b6c4e472df079d2b)) - Update google.core.version to v2.8.18 ([#​840](https://togithub.com/googleapis/java-shared-dependencies/issues/840)) ([46566dc](https://togithub.com/googleapis/java-shared-dependencies/commit/46566dc18c4b1ed41c482b4ce21b92651e2f9dc5)) - Update google.core.version to v2.8.19 ([#​841](https://togithub.com/googleapis/java-shared-dependencies/issues/841)) ([99afde9](https://togithub.com/googleapis/java-shared-dependencies/commit/99afde97ea498f549eb75cc58c4ed88edf81b20d)) - Update google.core.version to v2.8.20 ([#​848](https://togithub.com/googleapis/java-shared-dependencies/issues/848)) ([c980c4f](https://togithub.com/googleapis/java-shared-dependencies/commit/c980c4fdfc8890d812b4881ba5b87bfd21269a5f)) - Update iam.version to v1.6.1 ([#​806](https://togithub.com/googleapis/java-shared-dependencies/issues/806)) ([a50158d](https://togithub.com/googleapis/java-shared-dependencies/commit/a50158d3b83cf8e02d8ee08c94e512b5669a927b)) - Update iam.version to v1.6.2 ([#​849](https://togithub.com/googleapis/java-shared-dependencies/issues/849)) ([e43ac96](https://togithub.com/googleapis/java-shared-dependencies/commit/e43ac96bc189a096a9311c9b03e85c86bea07e99))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ca381a59..90d59a35 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.3 + 3.0.4 pom import From 1bbc2abbccb55d407a89372b66e27e2f8b014c6b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:28:17 +0000 Subject: [PATCH 27/43] chore(bazel): update protobuf to v3.21.7 (#928) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 477955264 Source-Link: https://togithub.com/googleapis/googleapis/commit/a724450af76d0001f23602684c49cd6a4b3a5654 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/4abcbcaec855e74a0b22a4988cf9e0eb61a83094 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGFiY2JjYWVjODU1ZTc0YTBiMjJhNDk4OGNmOWUwZWI2MWE4MzA5NCJ9 --- .../language/v1/AnalyzeEntitiesRequest.java | 135 +++---- .../language/v1/AnalyzeEntitiesResponse.java | 146 +++---- .../v1/AnalyzeEntitySentimentRequest.java | 135 +++---- .../v1/AnalyzeEntitySentimentResponse.java | 146 +++---- .../language/v1/AnalyzeSentimentRequest.java | 135 +++---- .../language/v1/AnalyzeSentimentResponse.java | 169 +++----- .../language/v1/AnalyzeSyntaxRequest.java | 135 +++---- .../language/v1/AnalyzeSyntaxResponse.java | 177 ++++---- .../language/v1/AnnotateTextRequest.java | 337 ++++++---------- .../language/v1/AnnotateTextResponse.java | 265 ++++++------ .../language/v1/ClassificationCategory.java | 124 +++--- .../v1/ClassificationModelOptions.java | 377 +++++++---------- .../language/v1/ClassifyTextRequest.java | 145 +++---- .../language/v1/ClassifyTextResponse.java | 136 +++---- .../cloud/language/v1/DependencyEdge.java | 123 +++--- .../google/cloud/language/v1/Document.java | 153 +++---- .../com/google/cloud/language/v1/Entity.java | 217 ++++------ .../cloud/language/v1/EntityMention.java | 156 +++---- .../cloud/language/v1/PartOfSpeech.java | 255 +++++------- .../google/cloud/language/v1/Sentence.java | 143 +++---- .../google/cloud/language/v1/Sentiment.java | 121 +++--- .../google/cloud/language/v1/TextSpan.java | 123 +++--- .../com/google/cloud/language/v1/Token.java | 178 +++----- .../v1beta2/AnalyzeEntitiesRequest.java | 135 +++---- .../v1beta2/AnalyzeEntitiesResponse.java | 146 +++---- .../AnalyzeEntitySentimentRequest.java | 136 +++---- .../AnalyzeEntitySentimentResponse.java | 147 +++---- .../v1beta2/AnalyzeSentimentRequest.java | 135 +++---- .../v1beta2/AnalyzeSentimentResponse.java | 169 +++----- .../v1beta2/AnalyzeSyntaxRequest.java | 135 +++---- .../v1beta2/AnalyzeSyntaxResponse.java | 177 ++++---- .../language/v1beta2/AnnotateTextRequest.java | 341 ++++++---------- .../v1beta2/AnnotateTextResponse.java | 266 ++++++------ .../v1beta2/ClassificationCategory.java | 124 +++--- .../v1beta2/ClassificationModelOptions.java | 381 +++++++----------- .../language/v1beta2/ClassifyTextRequest.java | 147 +++---- .../v1beta2/ClassifyTextResponse.java | 137 +++---- .../language/v1beta2/DependencyEdge.java | 123 +++--- .../cloud/language/v1beta2/Document.java | 179 ++++---- .../google/cloud/language/v1beta2/Entity.java | 219 +++++----- .../cloud/language/v1beta2/EntityMention.java | 156 +++---- .../cloud/language/v1beta2/PartOfSpeech.java | 255 +++++------- .../cloud/language/v1beta2/Sentence.java | 143 +++---- .../cloud/language/v1beta2/Sentiment.java | 121 +++--- .../cloud/language/v1beta2/TextSpan.java | 123 +++--- .../google/cloud/language/v1beta2/Token.java | 178 +++----- 46 files changed, 3219 insertions(+), 4885 deletions(-) diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java index 69dc1fbc..620d007a 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitiesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -421,17 +359,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeEntitiesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -534,7 +465,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitiesRequest oth if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -549,18 +480,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeEntitiesRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeEntitiesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -890,7 +846,18 @@ public AnalyzeEntitiesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitiesRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java index accd0b3e..2b668265 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java @@ -53,67 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitiesResponse( - 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)) { - entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entities_.add( - input.readMessage( - com.google.cloud.language.v1.Entity.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor; @@ -271,7 +210,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -286,7 +225,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -304,7 +243,7 @@ public boolean equals(final java.lang.Object obj) { if (!getEntitiesList().equals(other.getEntitiesList())) return false; if (!getLanguage().equals(other.getLanguage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -321,7 +260,7 @@ public int hashCode() { } hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -450,19 +389,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeEntitiesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEntitiesFieldBuilder(); - } } @java.lang.Override @@ -470,10 +400,11 @@ public Builder clear() { super.clear(); if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + entities_ = null; entitiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); language_ = ""; return this; @@ -595,7 +526,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitiesResponse ot language_ = other.language_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -610,18 +541,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeEntitiesResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.Entity m = + input.readMessage( + com.google.cloud.language.v1.Entity.parser(), extensionRegistry); + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(m); + } else { + entitiesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeEntitiesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1123,7 +1086,18 @@ public AnalyzeEntitiesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitiesResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java index e2320968..7c2e7f06 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitySentimentRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -422,17 +360,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -535,7 +466,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitySentimentRequ if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -550,18 +481,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeEntitySentimentRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -891,7 +847,18 @@ public AnalyzeEntitySentimentRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitySentimentRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java index 905425e5..70859072 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java @@ -54,67 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitySentimentResponse( - 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)) { - entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entities_.add( - input.readMessage( - com.google.cloud.language.v1.Entity.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor; @@ -272,7 +211,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -287,7 +226,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -305,7 +244,7 @@ public boolean equals(final java.lang.Object obj) { if (!getEntitiesList().equals(other.getEntitiesList())) return false; if (!getLanguage().equals(other.getLanguage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -322,7 +261,7 @@ public int hashCode() { } hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -452,19 +391,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEntitiesFieldBuilder(); - } } @java.lang.Override @@ -472,10 +402,11 @@ public Builder clear() { super.clear(); if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + entities_ = null; entitiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); language_ = ""; return this; @@ -597,7 +528,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitySentimentResp language_ = other.language_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -612,18 +543,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.Entity m = + input.readMessage( + com.google.cloud.language.v1.Entity.parser(), extensionRegistry); + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(m); + } else { + entitiesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeEntitySentimentResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1125,7 +1088,18 @@ public AnalyzeEntitySentimentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitySentimentResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java index 78045d28..f3a5f9f7 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSentimentRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -421,17 +359,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeSentimentRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -534,7 +465,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSentimentRequest ot if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -549,18 +480,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeSentimentRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeSentimentRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -890,7 +846,18 @@ public AnalyzeSentimentRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSentimentRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java index 49f6247c..be629c99 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java @@ -53,83 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSentimentResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Sentiment.Builder subBuilder = null; - if (documentSentiment_ != null) { - subBuilder = documentSentiment_.toBuilder(); - } - documentSentiment_ = - input.readMessage( - com.google.cloud.language.v1.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(documentSentiment_); - documentSentiment_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sentences_.add( - input.readMessage( - com.google.cloud.language.v1.Sentence.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor; @@ -338,7 +261,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < sentences_.size(); i++) { output.writeMessage(3, sentences_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -356,7 +279,7 @@ public int getSerializedSize() { for (int i = 0; i < sentences_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, sentences_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -378,7 +301,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getLanguage().equals(other.getLanguage())) return false; if (!getSentencesList().equals(other.getSentencesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -399,7 +322,7 @@ public int hashCode() { hash = (37 * hash) + SENTENCES_FIELD_NUMBER; hash = (53 * hash) + getSentencesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -529,19 +452,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeSentimentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSentencesFieldBuilder(); - } } @java.lang.Override @@ -557,10 +471,11 @@ public Builder clear() { if (sentencesBuilder_ == null) { sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + sentences_ = null; sentencesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -688,7 +603,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSentimentResponse o } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -703,18 +618,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeSentimentResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getDocumentSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.language.v1.Sentence m = + input.readMessage( + com.google.cloud.language.v1.Sentence.parser(), extensionRegistry); + if (sentencesBuilder_ == null) { + ensureSentencesIsMutable(); + sentences_.add(m); + } else { + sentencesBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeSentimentResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1402,7 +1356,18 @@ public AnalyzeSentimentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSentimentResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java index a607c012..e5cd33bb 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSyntaxRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -421,17 +359,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeSyntaxRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -534,7 +465,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSyntaxRequest other if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -549,18 +480,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeSyntaxRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeSyntaxRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -890,7 +846,18 @@ public AnalyzeSyntaxRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSyntaxRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java index 0288ed59..5d833f08 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java @@ -54,81 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSyntaxResponse( - 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)) { - sentences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sentences_.add( - input.readMessage( - com.google.cloud.language.v1.Sentence.parser(), extensionRegistry)); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - tokens_.add( - input.readMessage( - com.google.cloud.language.v1.Token.parser(), extensionRegistry)); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = java.util.Collections.unmodifiableList(tokens_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor; @@ -358,7 +283,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -376,7 +301,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -395,7 +320,7 @@ public boolean equals(final java.lang.Object obj) { if (!getSentencesList().equals(other.getSentencesList())) return false; if (!getTokensList().equals(other.getTokensList())) return false; if (!getLanguage().equals(other.getLanguage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -416,7 +341,7 @@ public int hashCode() { } hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -545,20 +470,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnalyzeSyntaxResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSentencesFieldBuilder(); - getTokensFieldBuilder(); - } } @java.lang.Override @@ -566,16 +481,18 @@ public Builder clear() { super.clear(); if (sentencesBuilder_ == null) { sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + sentences_ = null; sentencesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (tokensBuilder_ == null) { tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + tokens_ = null; tokensBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); language_ = ""; return this; @@ -733,7 +650,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSyntaxResponse othe language_ = other.language_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -748,18 +665,63 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnalyzeSyntaxResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.Sentence m = + input.readMessage( + com.google.cloud.language.v1.Sentence.parser(), extensionRegistry); + if (sentencesBuilder_ == null) { + ensureSentencesIsMutable(); + sentences_.add(m); + } else { + sentencesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.language.v1.Token m = + input.readMessage( + com.google.cloud.language.v1.Token.parser(), extensionRegistry); + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(m); + } else { + tokensBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnalyzeSyntaxResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1609,7 +1571,18 @@ public AnalyzeSyntaxResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSyntaxResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java index 69eb77b8..6f7603c5 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java @@ -53,85 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnnotateTextRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder subBuilder = null; - if (features_ != null) { - subBuilder = features_.toBuilder(); - } - features_ = - input.readMessage( - com.google.cloud.language.v1.AnnotateTextRequest.Features.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(features_); - features_ = subBuilder.buildPartial(); - } - - break; - } - case 24: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; @@ -292,87 +213,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Features( - 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: - { - extractSyntax_ = input.readBool(); - break; - } - case 16: - { - extractEntities_ = input.readBool(); - break; - } - case 24: - { - extractDocumentSentiment_ = input.readBool(); - break; - } - case 32: - { - extractEntitySentiment_ = input.readBool(); - break; - } - case 48: - { - classifyText_ = input.readBool(); - break; - } - case 82: - { - com.google.cloud.language.v1.ClassificationModelOptions.Builder subBuilder = null; - if (classificationModelOptions_ != null) { - subBuilder = classificationModelOptions_.toBuilder(); - } - classificationModelOptions_ = - input.readMessage( - com.google.cloud.language.v1.ClassificationModelOptions.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(classificationModelOptions_); - classificationModelOptions_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; @@ -565,7 +405,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classificationModelOptions_ != null) { output.writeMessage(10, getClassificationModelOptions()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -594,7 +434,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 10, getClassificationModelOptions()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -620,7 +460,7 @@ public boolean equals(final java.lang.Object obj) { if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -645,7 +485,7 @@ public int hashCode() { hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getClassificationModelOptions().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -778,17 +618,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnnotateTextRequest.Features.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -917,7 +750,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest.Featur if (other.hasClassificationModelOptions()) { mergeClassificationModelOptions(other.getClassificationModelOptions()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -932,18 +765,68 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnnotateTextRequest.Features parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + extractSyntax_ = input.readBool(); + + break; + } // case 8 + case 16: + { + extractEntities_ = input.readBool(); + + break; + } // case 16 + case 24: + { + extractDocumentSentiment_ = input.readBool(); + + break; + } // case 24 + case 32: + { + extractEntitySentiment_ = input.readBool(); + + break; + } // case 32 + case 48: + { + classifyText_ = input.readBool(); + + break; + } // case 48 + case 82: + { + input.readMessage( + getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnnotateTextRequest.Features) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1459,7 +1342,19 @@ public Features parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Features(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1645,7 +1540,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { output.writeEnum(3, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1663,7 +1558,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1688,7 +1583,7 @@ public boolean equals(final java.lang.Object obj) { if (!getFeatures().equals(other.getFeatures())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1709,7 +1604,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1839,17 +1734,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnnotateTextRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -1966,7 +1854,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest other) if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1981,17 +1869,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnnotateTextRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getFeaturesFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 24: + { + encodingType_ = input.readEnum(); + + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.AnnotateTextRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2526,7 +2446,18 @@ public AnnotateTextRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnnotateTextRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java index 56f2bb54..9f3ad604 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java @@ -56,127 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnnotateTextResponse( - 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)) { - sentences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sentences_.add( - input.readMessage( - com.google.cloud.language.v1.Sentence.parser(), extensionRegistry)); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - tokens_.add( - input.readMessage( - com.google.cloud.language.v1.Token.parser(), extensionRegistry)); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - entities_.add( - input.readMessage( - com.google.cloud.language.v1.Entity.parser(), extensionRegistry)); - break; - } - case 34: - { - com.google.cloud.language.v1.Sentiment.Builder subBuilder = null; - if (documentSentiment_ != null) { - subBuilder = documentSentiment_.toBuilder(); - } - documentSentiment_ = - input.readMessage( - com.google.cloud.language.v1.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(documentSentiment_); - documentSentiment_ = subBuilder.buildPartial(); - } - - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - case 50: - { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - categories_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - categories_.add( - input.readMessage( - com.google.cloud.language.v1.ClassificationCategory.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = java.util.Collections.unmodifiableList(tokens_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor; @@ -630,7 +509,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < categories_.size(); i++) { output.writeMessage(6, categories_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -657,7 +536,7 @@ public int getSerializedSize() { for (int i = 0; i < categories_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, categories_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -682,7 +561,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getLanguage().equals(other.getLanguage())) return false; if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -715,7 +594,7 @@ public int hashCode() { hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; hash = (53 * hash) + getCategoriesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -844,22 +723,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.AnnotateTextResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSentencesFieldBuilder(); - getTokensFieldBuilder(); - getEntitiesFieldBuilder(); - getCategoriesFieldBuilder(); - } } @java.lang.Override @@ -867,22 +734,25 @@ public Builder clear() { super.clear(); if (sentencesBuilder_ == null) { sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + sentences_ = null; sentencesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (tokensBuilder_ == null) { tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + tokens_ = null; tokensBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); } else { + entities_ = null; entitiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000004); if (documentSentimentBuilder_ == null) { documentSentiment_ = null; } else { @@ -893,10 +763,11 @@ public Builder clear() { if (categoriesBuilder_ == null) { categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); } else { + categories_ = null; categoriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -1132,7 +1003,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextResponse other } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1147,18 +1018,97 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.AnnotateTextResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.Sentence m = + input.readMessage( + com.google.cloud.language.v1.Sentence.parser(), extensionRegistry); + if (sentencesBuilder_ == null) { + ensureSentencesIsMutable(); + sentences_.add(m); + } else { + sentencesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.language.v1.Token m = + input.readMessage( + com.google.cloud.language.v1.Token.parser(), extensionRegistry); + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(m); + } else { + tokensBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.language.v1.Entity m = + input.readMessage( + com.google.cloud.language.v1.Entity.parser(), extensionRegistry); + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(m); + } else { + entitiesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + input.readMessage( + getDocumentSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 50: + { + com.google.cloud.language.v1.ClassificationCategory m = + input.readMessage( + com.google.cloud.language.v1.ClassificationCategory.parser(), + extensionRegistry); + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.add(m); + } else { + categoriesBuilder_.addMessage(m); + } + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.AnnotateTextResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2999,7 +2949,18 @@ public AnnotateTextResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnnotateTextResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java index fee218ac..0d385a3e 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java @@ -52,57 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassificationCategory( - 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 21: - { - 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 (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_ClassificationCategory_descriptor; @@ -208,7 +157,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { output.writeFloat(2, confidence_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -223,7 +172,7 @@ public int getSerializedSize() { if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -242,7 +191,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (java.lang.Float.floatToIntBits(getConfidence()) != java.lang.Float.floatToIntBits(other.getConfidence())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -257,7 +206,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -386,17 +335,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.ClassificationCategory.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -492,7 +434,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.ClassificationCategory oth if (other.getConfidence() != 0F) { setConfidence(other.getConfidence()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -507,18 +449,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.ClassificationCategory parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 21: + { + confidence_ = input.readFloat(); + + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.ClassificationCategory) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -720,7 +687,18 @@ public ClassificationCategory parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassificationCategory(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java index ef354d0b..3af41654 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java @@ -50,87 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassificationModelOptions( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder subBuilder = - null; - if (modelTypeCase_ == 1) { - subBuilder = - ((com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_) - .toBuilder(); - } - modelType_ = - input.readMessage( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); - modelType_ = subBuilder.buildPartial(); - } - modelTypeCase_ = 1; - break; - } - case 18: - { - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder subBuilder = - null; - if (modelTypeCase_ == 2) { - subBuilder = - ((com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_) - .toBuilder(); - } - modelType_ = - input.readMessage( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); - modelType_ = subBuilder.buildPartial(); - } - modelTypeCase_ = 2; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; @@ -182,45 +101,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private V1Model( - 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; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; @@ -250,7 +130,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -259,7 +139,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +155,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.language.v1.ClassificationModelOptions.V1Model other = (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -286,7 +166,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -420,17 +300,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.language.v1.ClassificationModelOptions.V1Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -518,7 +391,7 @@ public Builder mergeFrom( if (other == com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -533,19 +406,31 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.ClassificationModelOptions.V1Model parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -584,7 +469,19 @@ public V1Model parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new V1Model(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -673,52 +570,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private V2Model( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - contentCategoriesVersion_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; @@ -965,7 +816,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(1, contentCategoriesVersion_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -980,7 +831,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -997,7 +848,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) obj; if (contentCategoriesVersion_ != other.contentCategoriesVersion_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1010,7 +861,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; hash = (53 * hash) + contentCategoriesVersion_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1144,17 +995,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.language.v1.ClassificationModelOptions.V2Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -1248,7 +1092,7 @@ public Builder mergeFrom( if (other.contentCategoriesVersion_ != 0) { setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1263,19 +1107,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.ClassificationModelOptions.V2Model parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + contentCategoriesVersion_ = input.readEnum(); + + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1424,7 +1286,19 @@ public V2Model parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new V2Model(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1626,7 +1500,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage( 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1645,7 +1519,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1672,7 +1546,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1695,7 +1569,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1825,22 +1699,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.ClassificationModelOptions.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + if (v1ModelBuilder_ != null) { + v1ModelBuilder_.clear(); + } + if (v2ModelBuilder_ != null) { + v2ModelBuilder_.clear(); + } modelTypeCase_ = 0; modelType_ = null; return this; @@ -1951,7 +1824,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.ClassificationModelOptions break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1966,18 +1839,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.ClassificationModelOptions parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getV1ModelFieldBuilder().getBuilder(), extensionRegistry); + modelTypeCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getV2ModelFieldBuilder().getBuilder(), extensionRegistry); + modelTypeCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.ClassificationModelOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2488,7 +2386,18 @@ public ClassificationModelOptions parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassificationModelOptions(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java index 6a861980..ec488de6 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java @@ -50,78 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassifyTextRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.cloud.language.v1.ClassificationModelOptions.Builder subBuilder = null; - if (classificationModelOptions_ != null) { - subBuilder = classificationModelOptions_.toBuilder(); - } - classificationModelOptions_ = - input.readMessage( - com.google.cloud.language.v1.ClassificationModelOptions.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(classificationModelOptions_); - classificationModelOptions_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor; @@ -266,7 +194,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classificationModelOptions_ != null) { output.writeMessage(3, getClassificationModelOptions()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -283,7 +211,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 3, getClassificationModelOptions()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -308,7 +236,7 @@ public boolean equals(final java.lang.Object obj) { if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -327,7 +255,7 @@ public int hashCode() { hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getClassificationModelOptions().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -456,17 +384,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.ClassifyTextRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -577,7 +498,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.ClassifyTextRequest other) if (other.hasClassificationModelOptions()) { mergeClassificationModelOptions(other.getClassificationModelOptions()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -592,17 +513,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.ClassifyTextRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 26: + { + input.readMessage( + getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.ClassifyTextRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1050,7 +998,18 @@ public ClassifyTextRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassifyTextRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java index d54d3d34..8b3d3f11 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java @@ -52,62 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassifyTextResponse( - 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)) { - categories_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - categories_.add( - input.readMessage( - com.google.cloud.language.v1.ClassificationCategory.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor; @@ -210,7 +154,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < categories_.size(); i++) { output.writeMessage(1, categories_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -222,7 +166,7 @@ public int getSerializedSize() { for (int i = 0; i < categories_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, categories_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -239,7 +183,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.language.v1.ClassifyTextResponse) obj; if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -254,7 +198,7 @@ public int hashCode() { hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; hash = (53 * hash) + getCategoriesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -383,19 +327,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.ClassifyTextResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getCategoriesFieldBuilder(); - } } @java.lang.Override @@ -403,10 +338,11 @@ public Builder clear() { super.clear(); if (categoriesBuilder_ == null) { categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + categories_ = null; categoriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -521,7 +457,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.ClassifyTextResponse other } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -536,18 +472,45 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.ClassifyTextResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.ClassificationCategory m = + input.readMessage( + com.google.cloud.language.v1.ClassificationCategory.parser(), + extensionRegistry); + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.add(m); + } else { + categoriesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1.ClassifyTextResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -943,7 +906,18 @@ public ClassifyTextResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassifyTextResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java index 7d5f34a9..d95c65d7 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java @@ -54,57 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DependencyEdge( - 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: - { - headTokenIndex_ = input.readInt32(); - break; - } - case 16: - { - int rawValue = input.readEnum(); - - label_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_DependencyEdge_descriptor; @@ -2115,7 +2064,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (label_ != com.google.cloud.language.v1.DependencyEdge.Label.UNKNOWN.getNumber()) { output.writeEnum(2, label_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2130,7 +2079,7 @@ public int getSerializedSize() { if (label_ != com.google.cloud.language.v1.DependencyEdge.Label.UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, label_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -2148,7 +2097,7 @@ public boolean equals(final java.lang.Object obj) { if (getHeadTokenIndex() != other.getHeadTokenIndex()) return false; if (label_ != other.label_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2163,7 +2112,7 @@ public int hashCode() { hash = (53 * hash) + getHeadTokenIndex(); hash = (37 * hash) + LABEL_FIELD_NUMBER; hash = (53 * hash) + label_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -2294,17 +2243,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.DependencyEdge.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -2398,7 +2340,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.DependencyEdge other) { if (other.label_ != 0) { setLabelValue(other.getLabelValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2413,17 +2355,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.DependencyEdge parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + headTokenIndex_ = input.readInt32(); + + break; + } // case 8 + case 16: + { + label_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.DependencyEdge) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2616,7 +2584,18 @@ public DependencyEdge parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DependencyEdge(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java index b2b98e09..2d2fedb4 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java @@ -53,73 +53,6 @@ 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(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - sourceCase_ = 2; - source_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - sourceCase_ = 3; - source_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_Document_descriptor; @@ -618,7 +551,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -639,7 +572,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -667,7 +600,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -694,7 +627,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -822,17 +755,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.Document.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -956,7 +882,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.Document other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -971,17 +897,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.Document parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 2; + source_ = s; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 3; + source_ = s; + break; + } // case 26 + case 34: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.Document) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1560,7 +1526,18 @@ public Document parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Document(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java index 19b1912b..a9d75807 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java @@ -56,110 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Entity( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - metadata_ = - com.google.protobuf.MapField.newMapField( - MetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry metadata__ = - input.readMessage( - MetadataDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); - break; - } - case 37: - { - salience_ = input.readFloat(); - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - mentions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - mentions_.add( - input.readMessage( - com.google.cloud.language.v1.EntityMention.parser(), extensionRegistry)); - break; - } - case 50: - { - com.google.cloud.language.v1.Sentiment.Builder subBuilder = null; - if (sentiment_ != null) { - subBuilder = sentiment_.toBuilder(); - } - sentiment_ = - input.readMessage( - com.google.cloud.language.v1.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sentiment_); - sentiment_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - mentions_ = java.util.Collections.unmodifiableList(mentions_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_Entity_descriptor; @@ -998,7 +894,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sentiment_ != null) { output.writeMessage(6, getSentiment()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1032,7 +928,7 @@ public int getSerializedSize() { if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSentiment()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1057,7 +953,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSentiment()) { if (!getSentiment().equals(other.getSentiment())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1086,7 +982,7 @@ public int hashCode() { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1236,19 +1132,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.language.v1.Entity.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMentionsFieldBuilder(); - } } @java.lang.Override @@ -1263,10 +1150,11 @@ public Builder clear() { if (mentionsBuilder_ == null) { mentions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + mentions_ = null; mentionsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); if (sentimentBuilder_ == null) { sentiment_ = null; } else { @@ -1409,7 +1297,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.Entity other) { if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1424,17 +1312,79 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.Entity parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableMetadata() + .getMutableMap() + .put(metadata__.getKey(), metadata__.getValue()); + break; + } // case 26 + case 37: + { + salience_ = input.readFloat(); + + break; + } // case 37 + case 42: + { + com.google.cloud.language.v1.EntityMention m = + input.readMessage( + com.google.cloud.language.v1.EntityMention.parser(), extensionRegistry); + if (mentionsBuilder_ == null) { + ensureMentionsIsMutable(); + mentions_.add(m); + } else { + mentionsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + input.readMessage(getSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.Entity) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2492,7 +2442,18 @@ public Entity parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Entity(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java index e176c4ba..3c5eddc4 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java @@ -53,84 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private EntityMention( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.TextSpan.Builder subBuilder = null; - if (text_ != null) { - subBuilder = text_.toBuilder(); - } - text_ = - input.readMessage( - com.google.cloud.language.v1.TextSpan.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(text_); - text_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 26: - { - com.google.cloud.language.v1.Sentiment.Builder subBuilder = null; - if (sentiment_ != null) { - subBuilder = sentiment_.toBuilder(); - } - sentiment_ = - input.readMessage( - com.google.cloud.language.v1.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sentiment_); - sentiment_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_EntityMention_descriptor; @@ -465,7 +387,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sentiment_ != null) { output.writeMessage(3, getSentiment()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -483,7 +405,7 @@ public int getSerializedSize() { if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSentiment()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -508,7 +430,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSentiment()) { if (!getSentiment().equals(other.getSentiment())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -529,7 +451,7 @@ public int hashCode() { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -659,17 +581,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.EntityMention.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -785,7 +700,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.EntityMention other) { if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -800,17 +715,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.EntityMention parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + input.readMessage(getSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.EntityMention) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1330,7 +1277,18 @@ public EntityMention parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EntityMention(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/PartOfSpeech.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/PartOfSpeech.java index 7e5cddbf..2809ff29 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/PartOfSpeech.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/PartOfSpeech.java @@ -65,129 +65,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PartOfSpeech( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - tag_ = rawValue; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - aspect_ = rawValue; - break; - } - case 24: - { - int rawValue = input.readEnum(); - - case_ = rawValue; - break; - } - case 32: - { - int rawValue = input.readEnum(); - - form_ = rawValue; - break; - } - case 40: - { - int rawValue = input.readEnum(); - - gender_ = rawValue; - break; - } - case 48: - { - int rawValue = input.readEnum(); - - mood_ = rawValue; - break; - } - case 56: - { - int rawValue = input.readEnum(); - - number_ = rawValue; - break; - } - case 64: - { - int rawValue = input.readEnum(); - - person_ = rawValue; - break; - } - case 72: - { - int rawValue = input.readEnum(); - - proper_ = rawValue; - break; - } - case 80: - { - int rawValue = input.readEnum(); - - reciprocity_ = rawValue; - break; - } - case 88: - { - int rawValue = input.readEnum(); - - tense_ = rawValue; - break; - } - case 96: - { - int rawValue = input.readEnum(); - - voice_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_PartOfSpeech_descriptor; @@ -3592,7 +3469,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (voice_ != com.google.cloud.language.v1.PartOfSpeech.Voice.VOICE_UNKNOWN.getNumber()) { output.writeEnum(12, voice_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3638,7 +3515,7 @@ public int getSerializedSize() { if (voice_ != com.google.cloud.language.v1.PartOfSpeech.Voice.VOICE_UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, voice_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3666,7 +3543,7 @@ public boolean equals(final java.lang.Object obj) { if (reciprocity_ != other.reciprocity_) return false; if (tense_ != other.tense_) return false; if (voice_ != other.voice_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3701,7 +3578,7 @@ public int hashCode() { hash = (53 * hash) + tense_; hash = (37 * hash) + VOICE_FIELD_NUMBER; hash = (53 * hash) + voice_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3832,17 +3709,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.PartOfSpeech.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -3996,7 +3866,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.PartOfSpeech other) { if (other.voice_ != 0) { setVoiceValue(other.getVoiceValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -4011,17 +3881,103 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.PartOfSpeech parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + tag_ = input.readEnum(); + + break; + } // case 8 + case 16: + { + aspect_ = input.readEnum(); + + break; + } // case 16 + case 24: + { + case_ = input.readEnum(); + + break; + } // case 24 + case 32: + { + form_ = input.readEnum(); + + break; + } // case 32 + case 40: + { + gender_ = input.readEnum(); + + break; + } // case 40 + case 48: + { + mood_ = input.readEnum(); + + break; + } // case 48 + case 56: + { + number_ = input.readEnum(); + + break; + } // case 56 + case 64: + { + person_ = input.readEnum(); + + break; + } // case 64 + case 72: + { + proper_ = input.readEnum(); + + break; + } // case 72 + case 80: + { + reciprocity_ = input.readEnum(); + + break; + } // case 80 + case 88: + { + tense_ = input.readEnum(); + + break; + } // case 88 + case 96: + { + voice_ = input.readEnum(); + + break; + } // case 96 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.PartOfSpeech) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -5161,7 +5117,18 @@ public PartOfSpeech parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PartOfSpeech(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java index 461cdeb7..3c484892 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java @@ -50,77 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Sentence( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.TextSpan.Builder subBuilder = null; - if (text_ != null) { - subBuilder = text_.toBuilder(); - } - text_ = - input.readMessage( - com.google.cloud.language.v1.TextSpan.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(text_); - text_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.language.v1.Sentiment.Builder subBuilder = null; - if (sentiment_ != null) { - subBuilder = sentiment_.toBuilder(); - } - sentiment_ = - input.readMessage( - com.google.cloud.language.v1.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sentiment_); - sentiment_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_Sentence_descriptor; @@ -256,7 +185,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sentiment_ != null) { output.writeMessage(2, getSentiment()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -271,7 +200,7 @@ public int getSerializedSize() { if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSentiment()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -294,7 +223,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSentiment()) { if (!getSentiment().equals(other.getSentiment())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -313,7 +242,7 @@ public int hashCode() { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -441,17 +370,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.Sentence.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -561,7 +483,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.Sentence other) { if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -576,17 +498,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.Sentence parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.Sentence) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1006,7 +954,18 @@ public Sentence parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Sentence(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentiment.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentiment.java index 374374ac..529885eb 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentiment.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentiment.java @@ -51,55 +51,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Sentiment( - 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 21: - { - magnitude_ = input.readFloat(); - break; - } - case 29: - { - score_ = input.readFloat(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_Sentiment_descriptor; @@ -174,7 +125,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (java.lang.Float.floatToRawIntBits(score_) != 0) { output.writeFloat(3, score_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -189,7 +140,7 @@ public int getSerializedSize() { if (java.lang.Float.floatToRawIntBits(score_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, score_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -208,7 +159,7 @@ public boolean equals(final java.lang.Object obj) { != java.lang.Float.floatToIntBits(other.getMagnitude())) return false; if (java.lang.Float.floatToIntBits(getScore()) != java.lang.Float.floatToIntBits(other.getScore())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -223,7 +174,7 @@ public int hashCode() { hash = (53 * hash) + java.lang.Float.floatToIntBits(getMagnitude()); hash = (37 * hash) + SCORE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -353,17 +304,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.Sentiment.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -457,7 +401,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.Sentiment other) { if (other.getScore() != 0F) { setScore(other.getScore()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -472,17 +416,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.Sentiment parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 21: + { + magnitude_ = input.readFloat(); + + break; + } // case 21 + case 29: + { + score_ = input.readFloat(); + + break; + } // case 29 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.Sentiment) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -631,7 +601,18 @@ public Sentiment parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Sentiment(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java index 8f4dd269..584bd051 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java @@ -52,57 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private TextSpan( - 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(); - - content_ = s; - break; - } - case 16: - { - beginOffset_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_TextSpan_descriptor; @@ -206,7 +155,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (beginOffset_ != 0) { output.writeInt32(2, beginOffset_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -221,7 +170,7 @@ public int getSerializedSize() { if (beginOffset_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, beginOffset_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -238,7 +187,7 @@ public boolean equals(final java.lang.Object obj) { if (!getContent().equals(other.getContent())) return false; if (getBeginOffset() != other.getBeginOffset()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -253,7 +202,7 @@ public int hashCode() { hash = (53 * hash) + getContent().hashCode(); hash = (37 * hash) + BEGIN_OFFSET_FIELD_NUMBER; hash = (53 * hash) + getBeginOffset(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -381,17 +330,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.TextSpan.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -486,7 +428,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.TextSpan other) { if (other.getBeginOffset() != 0) { setBeginOffset(other.getBeginOffset()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -501,17 +443,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.TextSpan parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + content_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + beginOffset_ = input.readInt32(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.TextSpan) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -708,7 +676,18 @@ public TextSpan parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TextSpan(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Token.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Token.java index 8cc4ffa3..678ab987 100644 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Token.java +++ b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Token.java @@ -52,100 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Token( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.TextSpan.Builder subBuilder = null; - if (text_ != null) { - subBuilder = text_.toBuilder(); - } - text_ = - input.readMessage( - com.google.cloud.language.v1.TextSpan.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(text_); - text_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.language.v1.PartOfSpeech.Builder subBuilder = null; - if (partOfSpeech_ != null) { - subBuilder = partOfSpeech_.toBuilder(); - } - partOfSpeech_ = - input.readMessage( - com.google.cloud.language.v1.PartOfSpeech.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(partOfSpeech_); - partOfSpeech_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.cloud.language.v1.DependencyEdge.Builder subBuilder = null; - if (dependencyEdge_ != null) { - subBuilder = dependencyEdge_.toBuilder(); - } - dependencyEdge_ = - input.readMessage( - com.google.cloud.language.v1.DependencyEdge.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(dependencyEdge_); - dependencyEdge_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - lemma_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1.LanguageServiceProto .internal_static_google_cloud_language_v1_Token_descriptor; @@ -378,7 +284,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lemma_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, lemma_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -399,7 +305,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lemma_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, lemma_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -427,7 +333,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDependencyEdge().equals(other.getDependencyEdge())) return false; } if (!getLemma().equals(other.getLemma())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -452,7 +358,7 @@ public int hashCode() { } hash = (37 * hash) + LEMMA_FIELD_NUMBER; hash = (53 * hash) + getLemma().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -580,17 +486,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1.Token.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -720,7 +619,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.Token other) { lemma_ = other.lemma_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -735,17 +634,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1.Token parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getPartOfSpeechFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getDependencyEdgeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + lemma_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1.Token) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1440,7 +1377,18 @@ public Token parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Token(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesRequest.java index 670f3be1..c3ac815b 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitiesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1beta2.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -422,17 +360,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -535,7 +466,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeEntitiesReques if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -550,18 +481,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -891,7 +847,18 @@ public AnalyzeEntitiesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitiesRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesResponse.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesResponse.java index c0a6a475..74975d99 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesResponse.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesResponse.java @@ -53,67 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitiesResponse( - 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)) { - entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entities_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Entity.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_descriptor; @@ -271,7 +210,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -286,7 +225,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -304,7 +243,7 @@ public boolean equals(final java.lang.Object obj) { if (!getEntitiesList().equals(other.getEntitiesList())) return false; if (!getLanguage().equals(other.getLanguage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -321,7 +260,7 @@ public int hashCode() { } hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -451,19 +390,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEntitiesFieldBuilder(); - } } @java.lang.Override @@ -471,10 +401,11 @@ public Builder clear() { super.clear(); if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + entities_ = null; entitiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); language_ = ""; return this; @@ -596,7 +527,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeEntitiesRespon language_ = other.language_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -611,18 +542,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.Entity m = + input.readMessage( + com.google.cloud.language.v1beta2.Entity.parser(), extensionRegistry); + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(m); + } else { + entitiesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1125,7 +1088,18 @@ public AnalyzeEntitiesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitiesResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentRequest.java index c1047724..8847ce40 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitySentimentRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1beta2.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -422,17 +360,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -538,7 +469,7 @@ public Builder mergeFrom( if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -553,19 +484,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -897,7 +852,18 @@ public AnalyzeEntitySentimentRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitySentimentRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentResponse.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentResponse.java index b6c44df0..1e2ca123 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentResponse.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentResponse.java @@ -54,67 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeEntitySentimentResponse( - 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)) { - entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entities_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Entity.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_descriptor; @@ -272,7 +211,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -287,7 +226,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -305,7 +244,7 @@ public boolean equals(final java.lang.Object obj) { if (!getEntitiesList().equals(other.getEntitiesList())) return false; if (!getLanguage().equals(other.getLanguage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -322,7 +261,7 @@ public int hashCode() { } hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -452,19 +391,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEntitiesFieldBuilder(); - } } @java.lang.Override @@ -472,10 +402,11 @@ public Builder clear() { super.clear(); if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + entities_ = null; entitiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); language_ = ""; return this; @@ -600,7 +531,7 @@ public Builder mergeFrom( language_ = other.language_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -615,19 +546,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.Entity m = + input.readMessage( + com.google.cloud.language.v1beta2.Entity.parser(), extensionRegistry); + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(m); + } else { + entitiesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1132,7 +1094,18 @@ public AnalyzeEntitySentimentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeEntitySentimentResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentRequest.java index d169baf9..066caec1 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSentimentRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1beta2.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor; @@ -241,7 +179,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -256,7 +194,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -277,7 +215,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -294,7 +232,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -424,17 +362,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeSentimentRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -537,7 +468,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeSentimentReque if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -552,18 +483,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeSentimentRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -898,7 +854,18 @@ public AnalyzeSentimentRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSentimentRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentResponse.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentResponse.java index 6f4d6b62..b95c15bb 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentResponse.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentResponse.java @@ -53,83 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSentimentResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Sentiment.Builder subBuilder = null; - if (documentSentiment_ != null) { - subBuilder = documentSentiment_.toBuilder(); - } - documentSentiment_ = - input.readMessage( - com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(documentSentiment_); - documentSentiment_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sentences_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Sentence.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_descriptor; @@ -338,7 +261,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < sentences_.size(); i++) { output.writeMessage(3, sentences_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -356,7 +279,7 @@ public int getSerializedSize() { for (int i = 0; i < sentences_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, sentences_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -378,7 +301,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getLanguage().equals(other.getLanguage())) return false; if (!getSentencesList().equals(other.getSentencesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -399,7 +322,7 @@ public int hashCode() { hash = (37 * hash) + SENTENCES_FIELD_NUMBER; hash = (53 * hash) + getSentencesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -529,19 +452,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeSentimentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSentencesFieldBuilder(); - } } @java.lang.Override @@ -557,10 +471,11 @@ public Builder clear() { if (sentencesBuilder_ == null) { sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + sentences_ = null; sentencesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -688,7 +603,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeSentimentRespo } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -703,18 +618,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getDocumentSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.language.v1beta2.Sentence m = + input.readMessage( + com.google.cloud.language.v1beta2.Sentence.parser(), extensionRegistry); + if (sentencesBuilder_ == null) { + ensureSentencesIsMutable(); + sentences_.add(m); + } else { + sentencesBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeSentimentResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1405,7 +1359,18 @@ public AnalyzeSentimentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSentimentResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxRequest.java index ab231b96..50ec7e50 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSyntaxRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1beta2.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_descriptor; @@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { output.writeEnum(2, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -254,7 +192,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDocument().equals(other.getDocument())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -292,7 +230,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -422,17 +360,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -535,7 +466,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -550,18 +481,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + encodingType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -891,7 +847,18 @@ public AnalyzeSyntaxRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSyntaxRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxResponse.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxResponse.java index 9f8ec675..f457c783 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxResponse.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxResponse.java @@ -54,81 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeSyntaxResponse( - 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)) { - sentences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sentences_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Sentence.parser(), extensionRegistry)); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - tokens_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Token.parser(), extensionRegistry)); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = java.util.Collections.unmodifiableList(tokens_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_descriptor; @@ -358,7 +283,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, language_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -376,7 +301,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, language_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -395,7 +320,7 @@ public boolean equals(final java.lang.Object obj) { if (!getSentencesList().equals(other.getSentencesList())) return false; if (!getTokensList().equals(other.getTokensList())) return false; if (!getLanguage().equals(other.getLanguage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -416,7 +341,7 @@ public int hashCode() { } hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -546,20 +471,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSentencesFieldBuilder(); - getTokensFieldBuilder(); - } } @java.lang.Override @@ -567,16 +482,18 @@ public Builder clear() { super.clear(); if (sentencesBuilder_ == null) { sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + sentences_ = null; sentencesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (tokensBuilder_ == null) { tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + tokens_ = null; tokensBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); language_ = ""; return this; @@ -734,7 +651,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse language_ = other.language_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -749,18 +666,63 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.Sentence m = + input.readMessage( + com.google.cloud.language.v1beta2.Sentence.parser(), extensionRegistry); + if (sentencesBuilder_ == null) { + ensureSentencesIsMutable(); + sentences_.add(m); + } else { + sentencesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.language.v1beta2.Token m = + input.readMessage( + com.google.cloud.language.v1beta2.Token.parser(), extensionRegistry); + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(m); + } else { + tokensBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1613,7 +1575,18 @@ public AnalyzeSyntaxResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeSyntaxResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java index 2da5e0d9..f2924bad 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java @@ -53,86 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnnotateTextRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1beta2.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.language.v1beta2.AnnotateTextRequest.Features.Builder subBuilder = - null; - if (features_ != null) { - subBuilder = features_.toBuilder(); - } - features_ = - input.readMessage( - com.google.cloud.language.v1beta2.AnnotateTextRequest.Features.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(features_); - features_ = subBuilder.buildPartial(); - } - - break; - } - case 24: - { - int rawValue = input.readEnum(); - - encodingType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_descriptor; @@ -300,88 +220,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Features( - 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: - { - extractSyntax_ = input.readBool(); - break; - } - case 16: - { - extractEntities_ = input.readBool(); - break; - } - case 24: - { - extractDocumentSentiment_ = input.readBool(); - break; - } - case 32: - { - extractEntitySentiment_ = input.readBool(); - break; - } - case 48: - { - classifyText_ = input.readBool(); - break; - } - case 82: - { - com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder subBuilder = - null; - if (classificationModelOptions_ != null) { - subBuilder = classificationModelOptions_.toBuilder(); - } - classificationModelOptions_ = - input.readMessage( - com.google.cloud.language.v1beta2.ClassificationModelOptions.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(classificationModelOptions_); - classificationModelOptions_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_Features_descriptor; @@ -582,7 +420,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classificationModelOptions_ != null) { output.writeMessage(10, getClassificationModelOptions()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -611,7 +449,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 10, getClassificationModelOptions()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -637,7 +475,7 @@ public boolean equals(final java.lang.Object obj) { if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -662,7 +500,7 @@ public int hashCode() { hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getClassificationModelOptions().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -796,17 +634,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnnotateTextRequest.Features.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -938,7 +769,7 @@ public Builder mergeFrom( if (other.hasClassificationModelOptions()) { mergeClassificationModelOptions(other.getClassificationModelOptions()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -953,19 +784,68 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnnotateTextRequest.Features parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + extractSyntax_ = input.readBool(); + + break; + } // case 8 + case 16: + { + extractEntities_ = input.readBool(); + + break; + } // case 16 + case 24: + { + extractDocumentSentiment_ = input.readBool(); + + break; + } // case 24 + case 32: + { + extractEntitySentiment_ = input.readBool(); + + break; + } // case 32 + case 48: + { + classifyText_ = input.readBool(); + + break; + } // case 48 + case 82: + { + input.readMessage( + getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnnotateTextRequest.Features) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1493,7 +1373,19 @@ public Features parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Features(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1681,7 +1573,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { output.writeEnum(3, encodingType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1699,7 +1591,7 @@ public int getSerializedSize() { if (encodingType_ != com.google.cloud.language.v1beta2.EncodingType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encodingType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1724,7 +1616,7 @@ public boolean equals(final java.lang.Object obj) { if (!getFeatures().equals(other.getFeatures())) return false; } if (encodingType_ != other.encodingType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1745,7 +1637,7 @@ public int hashCode() { } hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; hash = (53 * hash) + encodingType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1876,17 +1768,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnnotateTextRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -2003,7 +1888,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnnotateTextRequest o if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2018,18 +1903,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnnotateTextRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getFeaturesFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 24: + { + encodingType_ = input.readEnum(); + + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnnotateTextRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2567,7 +2483,18 @@ public AnnotateTextRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnnotateTextRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextResponse.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextResponse.java index 1cbe1d9a..c5ff109d 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextResponse.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextResponse.java @@ -56,128 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnnotateTextResponse( - 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)) { - sentences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sentences_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Sentence.parser(), extensionRegistry)); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - tokens_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Token.parser(), extensionRegistry)); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - entities_.add( - input.readMessage( - com.google.cloud.language.v1beta2.Entity.parser(), extensionRegistry)); - break; - } - case 34: - { - com.google.cloud.language.v1beta2.Sentiment.Builder subBuilder = null; - if (documentSentiment_ != null) { - subBuilder = documentSentiment_.toBuilder(); - } - documentSentiment_ = - input.readMessage( - com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(documentSentiment_); - documentSentiment_ = subBuilder.buildPartial(); - } - - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - case 50: - { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - categories_ = - new java.util.ArrayList< - com.google.cloud.language.v1beta2.ClassificationCategory>(); - mutable_bitField0_ |= 0x00000008; - } - categories_.add( - input.readMessage( - com.google.cloud.language.v1beta2.ClassificationCategory.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - tokens_ = java.util.Collections.unmodifiableList(tokens_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_descriptor; @@ -632,7 +510,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < categories_.size(); i++) { output.writeMessage(6, categories_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -659,7 +537,7 @@ public int getSerializedSize() { for (int i = 0; i < categories_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, categories_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -684,7 +562,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getLanguage().equals(other.getLanguage())) return false; if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -717,7 +595,7 @@ public int hashCode() { hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; hash = (53 * hash) + getCategoriesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -847,22 +725,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.AnnotateTextResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSentencesFieldBuilder(); - getTokensFieldBuilder(); - getEntitiesFieldBuilder(); - getCategoriesFieldBuilder(); - } } @java.lang.Override @@ -870,22 +736,25 @@ public Builder clear() { super.clear(); if (sentencesBuilder_ == null) { sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + sentences_ = null; sentencesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (tokensBuilder_ == null) { tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + tokens_ = null; tokensBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); } else { + entities_ = null; entitiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000004); if (documentSentimentBuilder_ == null) { documentSentiment_ = null; } else { @@ -896,10 +765,11 @@ public Builder clear() { if (categoriesBuilder_ == null) { categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); } else { + categories_ = null; categoriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -1135,7 +1005,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.AnnotateTextResponse } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1150,18 +1020,97 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.AnnotateTextResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.Sentence m = + input.readMessage( + com.google.cloud.language.v1beta2.Sentence.parser(), extensionRegistry); + if (sentencesBuilder_ == null) { + ensureSentencesIsMutable(); + sentences_.add(m); + } else { + sentencesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.language.v1beta2.Token m = + input.readMessage( + com.google.cloud.language.v1beta2.Token.parser(), extensionRegistry); + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(m); + } else { + tokensBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.language.v1beta2.Entity m = + input.readMessage( + com.google.cloud.language.v1beta2.Entity.parser(), extensionRegistry); + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(m); + } else { + entitiesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + input.readMessage( + getDocumentSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 50: + { + com.google.cloud.language.v1beta2.ClassificationCategory m = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationCategory.parser(), + extensionRegistry); + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.add(m); + } else { + categoriesBuilder_.addMessage(m); + } + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.AnnotateTextResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3012,7 +2961,18 @@ public AnnotateTextResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnnotateTextResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationCategory.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationCategory.java index 0f5183cc..32da021b 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationCategory.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationCategory.java @@ -52,57 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassificationCategory( - 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 21: - { - 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 (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_ClassificationCategory_descriptor; @@ -208,7 +157,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { output.writeFloat(2, confidence_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -223,7 +172,7 @@ public int getSerializedSize() { if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -242,7 +191,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (java.lang.Float.floatToIntBits(getConfidence()) != java.lang.Float.floatToIntBits(other.getConfidence())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -257,7 +206,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -387,17 +336,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.ClassificationCategory.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -493,7 +435,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassificationCategor if (other.getConfidence() != 0F) { setConfidence(other.getConfidence()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -508,18 +450,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.ClassificationCategory parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 21: + { + confidence_ = input.readFloat(); + + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.ClassificationCategory) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -721,7 +688,18 @@ public ClassificationCategory parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassificationCategory(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java index 739ab382..e2216d64 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java @@ -50,91 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassificationModelOptions( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder - subBuilder = null; - if (modelTypeCase_ == 1) { - subBuilder = - ((com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) - modelType_) - .toBuilder(); - } - modelType_ = - input.readMessage( - com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) - modelType_); - modelType_ = subBuilder.buildPartial(); - } - modelTypeCase_ = 1; - break; - } - case 18: - { - com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder - subBuilder = null; - if (modelTypeCase_ == 2) { - subBuilder = - ((com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) - modelType_) - .toBuilder(); - } - modelType_ = - input.readMessage( - com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) - modelType_); - modelType_ = subBuilder.buildPartial(); - } - modelTypeCase_ = 2; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; @@ -186,45 +101,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private V1Model( - 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; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; @@ -254,7 +130,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -263,7 +139,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -279,7 +155,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model other = (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -290,7 +166,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -424,17 +300,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -525,7 +394,7 @@ public Builder mergeFrom( if (other == com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model .getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -540,19 +409,31 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -591,7 +472,19 @@ public V1Model parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new V1Model(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -680,52 +573,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private V2Model( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - contentCategoriesVersion_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; @@ -973,7 +820,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(1, contentCategoriesVersion_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -988,7 +835,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1005,7 +852,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) obj; if (contentCategoriesVersion_ != other.contentCategoriesVersion_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1018,7 +865,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; hash = (53 * hash) + contentCategoriesVersion_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1152,17 +999,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -1259,7 +1099,7 @@ public Builder mergeFrom( if (other.contentCategoriesVersion_ != 0) { setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1274,19 +1114,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + contentCategoriesVersion_ = input.readEnum(); + + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1437,7 +1295,19 @@ public V2Model parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new V2Model(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1643,7 +1513,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage( 2, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1662,7 +1532,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1689,7 +1559,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1712,7 +1582,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1842,22 +1712,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.ClassificationModelOptions.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + if (v1ModelBuilder_ != null) { + v1ModelBuilder_.clear(); + } + if (v2ModelBuilder_ != null) { + v2ModelBuilder_.clear(); + } modelTypeCase_ = 0; modelType_ = null; return this; @@ -1970,7 +1839,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassificationModelOp break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1985,18 +1854,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.ClassificationModelOptions parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getV1ModelFieldBuilder().getBuilder(), extensionRegistry); + modelTypeCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getV2ModelFieldBuilder().getBuilder(), extensionRegistry); + modelTypeCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.ClassificationModelOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2520,7 +2414,18 @@ public ClassificationModelOptions parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassificationModelOptions(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java index ced49eae..178172b7 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java @@ -50,79 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassifyTextRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.Document.Builder subBuilder = null; - if (document_ != null) { - subBuilder = document_.toBuilder(); - } - document_ = - input.readMessage( - com.google.cloud.language.v1beta2.Document.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(document_); - document_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder subBuilder = - null; - if (classificationModelOptions_ != null) { - subBuilder = classificationModelOptions_.toBuilder(); - } - classificationModelOptions_ = - input.readMessage( - com.google.cloud.language.v1beta2.ClassificationModelOptions.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(classificationModelOptions_); - classificationModelOptions_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_descriptor; @@ -271,7 +198,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classificationModelOptions_ != null) { output.writeMessage(3, getClassificationModelOptions()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -288,7 +215,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 3, getClassificationModelOptions()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -313,7 +240,7 @@ public boolean equals(final java.lang.Object obj) { if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -332,7 +259,7 @@ public int hashCode() { hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getClassificationModelOptions().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -462,17 +389,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.ClassifyTextRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -583,7 +503,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassifyTextRequest o if (other.hasClassificationModelOptions()) { mergeClassificationModelOptions(other.getClassificationModelOptions()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -598,18 +518,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.ClassifyTextRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 26: + { + input.readMessage( + getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.ClassifyTextRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1068,7 +1014,18 @@ public ClassifyTextRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassifyTextRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextResponse.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextResponse.java index a2e4e777..1dbbb1c8 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextResponse.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextResponse.java @@ -52,63 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ClassifyTextResponse( - 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)) { - categories_ = - new java.util.ArrayList< - com.google.cloud.language.v1beta2.ClassificationCategory>(); - mutable_bitField0_ |= 0x00000001; - } - categories_.add( - input.readMessage( - com.google.cloud.language.v1beta2.ClassificationCategory.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_descriptor; @@ -212,7 +155,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < categories_.size(); i++) { output.writeMessage(1, categories_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -224,7 +167,7 @@ public int getSerializedSize() { for (int i = 0; i < categories_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, categories_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -241,7 +184,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.language.v1beta2.ClassifyTextResponse) obj; if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -256,7 +199,7 @@ public int hashCode() { hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; hash = (53 * hash) + getCategoriesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -386,19 +329,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.ClassifyTextResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getCategoriesFieldBuilder(); - } } @java.lang.Override @@ -406,10 +340,11 @@ public Builder clear() { super.clear(); if (categoriesBuilder_ == null) { categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + categories_ = null; categoriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -524,7 +459,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassifyTextResponse } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -539,18 +474,45 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.ClassifyTextResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.ClassificationCategory m = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationCategory.parser(), + extensionRegistry); + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.add(m); + } else { + categoriesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.language.v1beta2.ClassifyTextResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -952,7 +914,18 @@ public ClassifyTextResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassifyTextResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DependencyEdge.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DependencyEdge.java index 31ee9fba..c3e1ede2 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DependencyEdge.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DependencyEdge.java @@ -52,57 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DependencyEdge( - 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: - { - headTokenIndex_ = input.readInt32(); - break; - } - case 16: - { - int rawValue = input.readEnum(); - - label_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_DependencyEdge_descriptor; @@ -2115,7 +2064,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (label_ != com.google.cloud.language.v1beta2.DependencyEdge.Label.UNKNOWN.getNumber()) { output.writeEnum(2, label_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2130,7 +2079,7 @@ public int getSerializedSize() { if (label_ != com.google.cloud.language.v1beta2.DependencyEdge.Label.UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, label_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -2148,7 +2097,7 @@ public boolean equals(final java.lang.Object obj) { if (getHeadTokenIndex() != other.getHeadTokenIndex()) return false; if (label_ != other.label_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2163,7 +2112,7 @@ public int hashCode() { hash = (53 * hash) + getHeadTokenIndex(); hash = (37 * hash) + LABEL_FIELD_NUMBER; hash = (53 * hash) + label_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -2292,17 +2241,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.DependencyEdge.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -2397,7 +2339,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.DependencyEdge other) if (other.label_ != 0) { setLabelValue(other.getLabelValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2412,17 +2354,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.DependencyEdge parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + headTokenIndex_ = input.readInt32(); + + break; + } // case 8 + case 16: + { + label_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.DependencyEdge) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2615,7 +2583,18 @@ public DependencyEdge parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DependencyEdge(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java index 84392173..28011af6 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java @@ -55,87 +55,6 @@ 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(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - sourceCase_ = 2; - source_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - sourceCase_ = 3; - source_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - language_ = s; - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - referenceWebUri_ = s; - break; - } - case 48: - { - int rawValue = input.readEnum(); - - boilerplateHandling_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_Document_descriptor; @@ -901,7 +820,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(6, boilerplateHandling_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -931,7 +850,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, boilerplateHandling_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -962,7 +881,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -993,7 +912,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1122,17 +1041,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.Document.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -1269,7 +1181,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Document other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1284,17 +1196,69 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.Document parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 2; + source_ = s; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 3; + source_ = s; + break; + } // case 26 + case 34: + { + language_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + referenceWebUri_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 48: + { + boilerplateHandling_ = input.readEnum(); + + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.Document) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2094,7 +2058,18 @@ public Document parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Document(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Entity.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Entity.java index baed058e..7c9fc62d 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Entity.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Entity.java @@ -56,111 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Entity( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - metadata_ = - com.google.protobuf.MapField.newMapField( - MetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry metadata__ = - input.readMessage( - MetadataDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); - break; - } - case 37: - { - salience_ = input.readFloat(); - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - mentions_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - mentions_.add( - input.readMessage( - com.google.cloud.language.v1beta2.EntityMention.parser(), extensionRegistry)); - break; - } - case 50: - { - com.google.cloud.language.v1beta2.Sentiment.Builder subBuilder = null; - if (sentiment_ != null) { - subBuilder = sentiment_.toBuilder(); - } - sentiment_ = - input.readMessage( - com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sentiment_); - sentiment_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - mentions_ = java.util.Collections.unmodifiableList(mentions_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_Entity_descriptor; @@ -999,7 +894,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sentiment_ != null) { output.writeMessage(6, getSentiment()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1033,7 +928,7 @@ public int getSerializedSize() { if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSentiment()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1058,7 +953,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSentiment()) { if (!getSentiment().equals(other.getSentiment())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1087,7 +982,7 @@ public int hashCode() { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1238,19 +1133,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.language.v1beta2.Entity.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMentionsFieldBuilder(); - } } @java.lang.Override @@ -1265,10 +1151,11 @@ public Builder clear() { if (mentionsBuilder_ == null) { mentions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + mentions_ = null; mentionsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); if (sentimentBuilder_ == null) { sentiment_ = null; } else { @@ -1412,7 +1299,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Entity other) { if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1427,17 +1314,80 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.Entity parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableMetadata() + .getMutableMap() + .put(metadata__.getKey(), metadata__.getValue()); + break; + } // case 26 + case 37: + { + salience_ = input.readFloat(); + + break; + } // case 37 + case 42: + { + com.google.cloud.language.v1beta2.EntityMention m = + input.readMessage( + com.google.cloud.language.v1beta2.EntityMention.parser(), + extensionRegistry); + if (mentionsBuilder_ == null) { + ensureMentionsIsMutable(); + mentions_.add(m); + } else { + mentionsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + input.readMessage(getSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.Entity) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2499,7 +2449,18 @@ public Entity parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Entity(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityMention.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityMention.java index 3b80ef58..01be0407 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityMention.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityMention.java @@ -53,84 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private EntityMention( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.TextSpan.Builder subBuilder = null; - if (text_ != null) { - subBuilder = text_.toBuilder(); - } - text_ = - input.readMessage( - com.google.cloud.language.v1beta2.TextSpan.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(text_); - text_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 26: - { - com.google.cloud.language.v1beta2.Sentiment.Builder subBuilder = null; - if (sentiment_ != null) { - subBuilder = sentiment_.toBuilder(); - } - sentiment_ = - input.readMessage( - com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sentiment_); - sentiment_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_EntityMention_descriptor; @@ -467,7 +389,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sentiment_ != null) { output.writeMessage(3, getSentiment()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -485,7 +407,7 @@ public int getSerializedSize() { if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSentiment()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -510,7 +432,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSentiment()) { if (!getSentiment().equals(other.getSentiment())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -531,7 +453,7 @@ public int hashCode() { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -661,17 +583,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.EntityMention.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -788,7 +703,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.EntityMention other) if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -803,17 +718,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.EntityMention parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + input.readMessage(getSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.EntityMention) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1340,7 +1287,18 @@ public EntityMention parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EntityMention(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/PartOfSpeech.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/PartOfSpeech.java index 7a0fd78e..e717fe05 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/PartOfSpeech.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/PartOfSpeech.java @@ -63,129 +63,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PartOfSpeech( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - tag_ = rawValue; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - aspect_ = rawValue; - break; - } - case 24: - { - int rawValue = input.readEnum(); - - case_ = rawValue; - break; - } - case 32: - { - int rawValue = input.readEnum(); - - form_ = rawValue; - break; - } - case 40: - { - int rawValue = input.readEnum(); - - gender_ = rawValue; - break; - } - case 48: - { - int rawValue = input.readEnum(); - - mood_ = rawValue; - break; - } - case 56: - { - int rawValue = input.readEnum(); - - number_ = rawValue; - break; - } - case 64: - { - int rawValue = input.readEnum(); - - person_ = rawValue; - break; - } - case 72: - { - int rawValue = input.readEnum(); - - proper_ = rawValue; - break; - } - case 80: - { - int rawValue = input.readEnum(); - - reciprocity_ = rawValue; - break; - } - case 88: - { - int rawValue = input.readEnum(); - - tense_ = rawValue; - break; - } - case 96: - { - int rawValue = input.readEnum(); - - voice_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_PartOfSpeech_descriptor; @@ -3618,7 +3495,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (voice_ != com.google.cloud.language.v1beta2.PartOfSpeech.Voice.VOICE_UNKNOWN.getNumber()) { output.writeEnum(12, voice_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3670,7 +3547,7 @@ public int getSerializedSize() { if (voice_ != com.google.cloud.language.v1beta2.PartOfSpeech.Voice.VOICE_UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, voice_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3698,7 +3575,7 @@ public boolean equals(final java.lang.Object obj) { if (reciprocity_ != other.reciprocity_) return false; if (tense_ != other.tense_) return false; if (voice_ != other.voice_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3733,7 +3610,7 @@ public int hashCode() { hash = (53 * hash) + tense_; hash = (37 * hash) + VOICE_FIELD_NUMBER; hash = (53 * hash) + voice_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3862,17 +3739,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.PartOfSpeech.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -4026,7 +3896,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.PartOfSpeech other) { if (other.voice_ != 0) { setVoiceValue(other.getVoiceValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -4041,17 +3911,103 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.PartOfSpeech parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + tag_ = input.readEnum(); + + break; + } // case 8 + case 16: + { + aspect_ = input.readEnum(); + + break; + } // case 16 + case 24: + { + case_ = input.readEnum(); + + break; + } // case 24 + case 32: + { + form_ = input.readEnum(); + + break; + } // case 32 + case 40: + { + gender_ = input.readEnum(); + + break; + } // case 40 + case 48: + { + mood_ = input.readEnum(); + + break; + } // case 48 + case 56: + { + number_ = input.readEnum(); + + break; + } // case 56 + case 64: + { + person_ = input.readEnum(); + + break; + } // case 64 + case 72: + { + proper_ = input.readEnum(); + + break; + } // case 72 + case 80: + { + reciprocity_ = input.readEnum(); + + break; + } // case 80 + case 88: + { + tense_ = input.readEnum(); + + break; + } // case 88 + case 96: + { + voice_ = input.readEnum(); + + break; + } // case 96 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.PartOfSpeech) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -5204,7 +5160,18 @@ public PartOfSpeech parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PartOfSpeech(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentence.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentence.java index d6095a60..25a606ad 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentence.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentence.java @@ -50,77 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Sentence( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.TextSpan.Builder subBuilder = null; - if (text_ != null) { - subBuilder = text_.toBuilder(); - } - text_ = - input.readMessage( - com.google.cloud.language.v1beta2.TextSpan.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(text_); - text_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.language.v1beta2.Sentiment.Builder subBuilder = null; - if (sentiment_ != null) { - subBuilder = sentiment_.toBuilder(); - } - sentiment_ = - input.readMessage( - com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sentiment_); - sentiment_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_Sentence_descriptor; @@ -256,7 +185,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sentiment_ != null) { output.writeMessage(2, getSentiment()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -271,7 +200,7 @@ public int getSerializedSize() { if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSentiment()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -295,7 +224,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSentiment()) { if (!getSentiment().equals(other.getSentiment())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -314,7 +243,7 @@ public int hashCode() { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -443,17 +372,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.Sentence.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -563,7 +485,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Sentence other) { if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -578,17 +500,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.Sentence parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getSentimentFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.Sentence) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1013,7 +961,18 @@ public Sentence parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Sentence(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentiment.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentiment.java index 397dcf2f..401ca231 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentiment.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentiment.java @@ -52,55 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Sentiment( - 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 21: - { - magnitude_ = input.readFloat(); - break; - } - case 29: - { - score_ = input.readFloat(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_Sentiment_descriptor; @@ -175,7 +126,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (java.lang.Float.floatToRawIntBits(score_) != 0) { output.writeFloat(3, score_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -190,7 +141,7 @@ public int getSerializedSize() { if (java.lang.Float.floatToRawIntBits(score_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, score_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -210,7 +161,7 @@ public boolean equals(final java.lang.Object obj) { != java.lang.Float.floatToIntBits(other.getMagnitude())) return false; if (java.lang.Float.floatToIntBits(getScore()) != java.lang.Float.floatToIntBits(other.getScore())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,7 +176,7 @@ public int hashCode() { hash = (53 * hash) + java.lang.Float.floatToIntBits(getMagnitude()); hash = (37 * hash) + SCORE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -356,17 +307,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.Sentiment.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -460,7 +404,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Sentiment other) { if (other.getScore() != 0F) { setScore(other.getScore()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -475,17 +419,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.Sentiment parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 21: + { + magnitude_ = input.readFloat(); + + break; + } // case 21 + case 29: + { + score_ = input.readFloat(); + + break; + } // case 29 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.Sentiment) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -634,7 +604,18 @@ public Sentiment parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Sentiment(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TextSpan.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TextSpan.java index 2f28dfa9..dfb84404 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TextSpan.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TextSpan.java @@ -52,57 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private TextSpan( - 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(); - - content_ = s; - break; - } - case 16: - { - beginOffset_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_TextSpan_descriptor; @@ -206,7 +155,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (beginOffset_ != 0) { output.writeInt32(2, beginOffset_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -221,7 +170,7 @@ public int getSerializedSize() { if (beginOffset_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, beginOffset_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -239,7 +188,7 @@ public boolean equals(final java.lang.Object obj) { if (!getContent().equals(other.getContent())) return false; if (getBeginOffset() != other.getBeginOffset()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -254,7 +203,7 @@ public int hashCode() { hash = (53 * hash) + getContent().hashCode(); hash = (37 * hash) + BEGIN_OFFSET_FIELD_NUMBER; hash = (53 * hash) + getBeginOffset(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -383,17 +332,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.TextSpan.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -488,7 +430,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.TextSpan other) { if (other.getBeginOffset() != 0) { setBeginOffset(other.getBeginOffset()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -503,17 +445,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.TextSpan parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + content_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + beginOffset_ = input.readInt32(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.TextSpan) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -710,7 +678,18 @@ public TextSpan parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TextSpan(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Token.java b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Token.java index 8b3ed372..a7f130a2 100644 --- a/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Token.java +++ b/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Token.java @@ -52,100 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Token( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1beta2.TextSpan.Builder subBuilder = null; - if (text_ != null) { - subBuilder = text_.toBuilder(); - } - text_ = - input.readMessage( - com.google.cloud.language.v1beta2.TextSpan.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(text_); - text_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.language.v1beta2.PartOfSpeech.Builder subBuilder = null; - if (partOfSpeech_ != null) { - subBuilder = partOfSpeech_.toBuilder(); - } - partOfSpeech_ = - input.readMessage( - com.google.cloud.language.v1beta2.PartOfSpeech.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(partOfSpeech_); - partOfSpeech_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.cloud.language.v1beta2.DependencyEdge.Builder subBuilder = null; - if (dependencyEdge_ != null) { - subBuilder = dependencyEdge_.toBuilder(); - } - dependencyEdge_ = - input.readMessage( - com.google.cloud.language.v1beta2.DependencyEdge.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(dependencyEdge_); - dependencyEdge_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - lemma_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().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.language.v1beta2.LanguageServiceProto .internal_static_google_cloud_language_v1beta2_Token_descriptor; @@ -378,7 +284,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lemma_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, lemma_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -399,7 +305,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lemma_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, lemma_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -427,7 +333,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDependencyEdge().equals(other.getDependencyEdge())) return false; } if (!getLemma().equals(other.getLemma())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -452,7 +358,7 @@ public int hashCode() { } hash = (37 * hash) + LEMMA_FIELD_NUMBER; hash = (53 * hash) + getLemma().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -581,17 +487,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.language.v1beta2.Token.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -722,7 +621,7 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Token other) { lemma_ = other.lemma_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -737,17 +636,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.language.v1beta2.Token parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getPartOfSpeechFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getDependencyEdgeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + lemma_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.language.v1beta2.Token) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1446,7 +1383,18 @@ public Token parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Token(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; From 9ad17f6d6a985e1466aad135bab4f4ed390d2b41 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 00:14:19 +0000 Subject: [PATCH 28/43] chore(main): release 2.4.1 (#904) :robot: I have created a release *beep* *boop* --- ## [2.4.1](https://togithub.com/googleapis/java-language/compare/v2.4.0...v2.4.1) (2022-10-03) ### Documentation * Update classification sample to use v2 model ([#899](https://togithub.com/googleapis/java-language/issues/899)) ([7b3a5f8](https://togithub.com/googleapis/java-language/commit/7b3a5f86b7de401198e74e76ba7af1f1599ae6cc)) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#929](https://togithub.com/googleapis/java-language/issues/929)) ([805563b](https://togithub.com/googleapis/java-language/commit/805563b083bb04bfa59ef7fc4418c6950b3340db)) * Update dependency google-api-core to v2.10.1 ([#921](https://togithub.com/googleapis/java-language/issues/921)) ([8b39a51](https://togithub.com/googleapis/java-language/commit/8b39a51acbc452afc2bb045f6d88bbdfc46b81ed)) * Update dependency google-auth to v2.12.0 ([#922](https://togithub.com/googleapis/java-language/issues/922)) ([f273003](https://togithub.com/googleapis/java-language/commit/f273003a294fb2d116c78f25848bd22fa8f18fc8)) * Update dependency google-cloud-storage to v2.5.0 ([#923](https://togithub.com/googleapis/java-language/issues/923)) ([c34885b](https://togithub.com/googleapis/java-language/commit/c34885ba6ad41c8eeeeda2ad9feb20f89f67e589)) * Update dependency google-crc32c to v1.5.0 ([#924](https://togithub.com/googleapis/java-language/issues/924)) ([51baceb](https://togithub.com/googleapis/java-language/commit/51baceb6bf821f3da41569b27cd7cdf745bd1db8)) * Update dependency importlib-metadata to v4.12.0 ([#925](https://togithub.com/googleapis/java-language/issues/925)) ([a246f0d](https://togithub.com/googleapis/java-language/commit/a246f0dcc43ce8faeefdf998011222df294d27fa)) * Update dependency jeepney to v0.8.0 ([#926](https://togithub.com/googleapis/java-language/issues/926)) ([04a307a](https://togithub.com/googleapis/java-language/commit/04a307ad130c3adfb2471aac551ebfc674c0d060)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 9 files changed, 45 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a4ae36b..7b0df832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.4.1](https://github.com/googleapis/java-language/compare/v2.4.0...v2.4.1) (2022-10-03) + + +### Documentation + +* Update classification sample to use v2 model ([#899](https://github.com/googleapis/java-language/issues/899)) ([7b3a5f8](https://github.com/googleapis/java-language/commit/7b3a5f86b7de401198e74e76ba7af1f1599ae6cc)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#929](https://github.com/googleapis/java-language/issues/929)) ([805563b](https://github.com/googleapis/java-language/commit/805563b083bb04bfa59ef7fc4418c6950b3340db)) +* Update dependency google-api-core to v2.10.1 ([#921](https://github.com/googleapis/java-language/issues/921)) ([8b39a51](https://github.com/googleapis/java-language/commit/8b39a51acbc452afc2bb045f6d88bbdfc46b81ed)) +* Update dependency google-auth to v2.12.0 ([#922](https://github.com/googleapis/java-language/issues/922)) ([f273003](https://github.com/googleapis/java-language/commit/f273003a294fb2d116c78f25848bd22fa8f18fc8)) +* Update dependency google-cloud-storage to v2.5.0 ([#923](https://github.com/googleapis/java-language/issues/923)) ([c34885b](https://github.com/googleapis/java-language/commit/c34885ba6ad41c8eeeeda2ad9feb20f89f67e589)) +* Update dependency google-crc32c to v1.5.0 ([#924](https://github.com/googleapis/java-language/issues/924)) ([51baceb](https://github.com/googleapis/java-language/commit/51baceb6bf821f3da41569b27cd7cdf745bd1db8)) +* Update dependency importlib-metadata to v4.12.0 ([#925](https://github.com/googleapis/java-language/issues/925)) ([a246f0d](https://github.com/googleapis/java-language/commit/a246f0dcc43ce8faeefdf998011222df294d27fa)) +* Update dependency jeepney to v0.8.0 ([#926](https://github.com/googleapis/java-language/issues/926)) ([04a307a](https://github.com/googleapis/java-language/commit/04a307ad130c3adfb2471aac551ebfc674c0d060)) + ## [2.4.0](https://github.com/googleapis/java-language/compare/v2.3.4...v2.4.0) (2022-09-26) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index 6eddb1e6..c413ed0a 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.4.1-SNAPSHOT + 2.4.1 pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.4.1-SNAPSHOT + 2.4.1 com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.1-SNAPSHOT + 2.4.1 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.1-SNAPSHOT + 0.91.1 com.google.api.grpc proto-google-cloud-language-v1 - 2.4.1-SNAPSHOT + 2.4.1 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.1-SNAPSHOT + 0.91.1
diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 602de9bd..807e7c9c 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.4.1-SNAPSHOT + 2.4.1 jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.4.1-SNAPSHOT + 2.4.1 google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index 5e45623d..3214beab 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.1-SNAPSHOT + 2.4.1 grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index cf8d2bdb..e29e5458 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.1-SNAPSHOT + 0.91.1 grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/pom.xml b/pom.xml index 90d59a35..16576df3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.4.1-SNAPSHOT + 2.4.1 Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.4.1-SNAPSHOT + 2.4.1 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.1-SNAPSHOT + 0.91.1 com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.1-SNAPSHOT + 2.4.1 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.1-SNAPSHOT + 0.91.1 com.google.cloud google-cloud-language - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index 0a64c4ce..272404d2 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.4.1-SNAPSHOT + 2.4.1 proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index 23d27738..d7aa331f 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.1-SNAPSHOT + 0.91.1 proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/versions.txt b/versions.txt index 43b1a439..2da55912 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.4.0:2.4.1-SNAPSHOT -grpc-google-cloud-language-v1:2.4.0:2.4.1-SNAPSHOT -grpc-google-cloud-language-v1beta2:0.91.0:0.91.1-SNAPSHOT -proto-google-cloud-language-v1:2.4.0:2.4.1-SNAPSHOT -proto-google-cloud-language-v1beta2:0.91.0:0.91.1-SNAPSHOT +google-cloud-language:2.4.1:2.4.1 +grpc-google-cloud-language-v1:2.4.1:2.4.1 +grpc-google-cloud-language-v1beta2:0.91.1:0.91.1 +proto-google-cloud-language-v1:2.4.1:2.4.1 +proto-google-cloud-language-v1beta2:0.91.1:0.91.1 From 2a426b16639f6a3f38c07368709a20c603a6f4dd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 00:32:17 +0000 Subject: [PATCH 29/43] chore(main): release 2.4.2-SNAPSHOT (#930) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- google-cloud-language-bom/pom.xml | 12 ++++++------ google-cloud-language/pom.xml | 4 ++-- grpc-google-cloud-language-v1/pom.xml | 4 ++-- grpc-google-cloud-language-v1beta2/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-language-v1/pom.xml | 4 ++-- proto-google-cloud-language-v1beta2/pom.xml | 4 ++-- versions.txt | 10 +++++----- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index c413ed0a..c09ad678 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language-bom - 2.4.1 + 2.4.2-SNAPSHOT pom com.google.cloud @@ -52,27 +52,27 @@ com.google.cloud google-cloud-language - 2.4.1 + 2.4.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.1 + 2.4.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.1 + 0.91.2-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1 - 2.4.1 + 2.4.2-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.1 + 0.91.2-SNAPSHOT diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml index 807e7c9c..da555089 100644 --- a/google-cloud-language/pom.xml +++ b/google-cloud-language/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-language - 2.4.1 + 2.4.2-SNAPSHOT jar Google Cloud Natural Language https://github.com/googleapis/java-language @@ -11,7 +11,7 @@ com.google.cloud google-cloud-language-parent - 2.4.1 + 2.4.2-SNAPSHOT google-cloud-language diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml index 3214beab..e806007d 100644 --- a/grpc-google-cloud-language-v1/pom.xml +++ b/grpc-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.1 + 2.4.2-SNAPSHOT grpc-google-cloud-language-v1 GRPC library for grpc-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml index e29e5458..fed435ad 100644 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ b/grpc-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.1 + 0.91.2-SNAPSHOT grpc-google-cloud-language-v1beta2 GRPC library for grpc-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index 16576df3..305adb40 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-language-parent pom - 2.4.1 + 2.4.2-SNAPSHOT Google Cloud Natural Language Parent https://github.com/googleapis/java-language @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-language-v1 - 2.4.1 + 2.4.2-SNAPSHOT com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.1 + 0.91.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1 - 2.4.1 + 2.4.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-language-v1beta2 - 0.91.1 + 0.91.2-SNAPSHOT com.google.cloud google-cloud-language - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml index 272404d2..ad72228f 100644 --- a/proto-google-cloud-language-v1/pom.xml +++ b/proto-google-cloud-language-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1 - 2.4.1 + 2.4.2-SNAPSHOT proto-google-cloud-language-v1 PROTO library for proto-google-cloud-language-v1 com.google.cloud google-cloud-language-parent - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/proto-google-cloud-language-v1beta2/pom.xml b/proto-google-cloud-language-v1beta2/pom.xml index d7aa331f..16481424 100644 --- a/proto-google-cloud-language-v1beta2/pom.xml +++ b/proto-google-cloud-language-v1beta2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-language-v1beta2 - 0.91.1 + 0.91.2-SNAPSHOT proto-google-cloud-language-v1beta2 PROTO library for proto-google-cloud-language-v1beta2 com.google.cloud google-cloud-language-parent - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 2da55912..c7c747a7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-language:2.4.1:2.4.1 -grpc-google-cloud-language-v1:2.4.1:2.4.1 -grpc-google-cloud-language-v1beta2:0.91.1:0.91.1 -proto-google-cloud-language-v1:2.4.1:2.4.1 -proto-google-cloud-language-v1beta2:0.91.1:0.91.1 +google-cloud-language:2.4.1:2.4.2-SNAPSHOT +grpc-google-cloud-language-v1:2.4.1:2.4.2-SNAPSHOT +grpc-google-cloud-language-v1beta2:0.91.1:0.91.2-SNAPSHOT +proto-google-cloud-language-v1:2.4.1:2.4.2-SNAPSHOT +proto-google-cloud-language-v1beta2:0.91.1:0.91.2-SNAPSHOT From e12c58c3df6754b24667b276044acccd9e9259a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 20:30:16 +0200 Subject: [PATCH 30/43] chore(deps): update dependency com.google.cloud:google-cloud-language to v2.4.0 (#903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-language](https://togithub.com/googleapis/java-language) | `2.3.4` -> `2.4.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/compatibility-slim/2.3.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/confidence-slim/2.3.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dede7d79..0814c06d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-language - 2.3.4 + 2.4.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 23aecd0c..0a06cbf2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-language - 2.3.4 + 2.4.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a758fbb9..0d431ed2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-language - 2.3.4 + 2.4.0 From e1e42cd2c809d4952d1eb4231b764c9746a73099 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 22:00:26 +0200 Subject: [PATCH 31/43] chore(deps): update dependency com.google.cloud:google-cloud-language to v2.4.1 (#931) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-language](https://togithub.com/googleapis/java-language) | `2.4.0` -> `2.4.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/compatibility-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-language/2.4.1/confidence-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-language ### [`v2.4.1`](https://togithub.com/googleapis/java-language/blob/HEAD/CHANGELOG.md#​241-httpsgithubcomgoogleapisjava-languagecomparev240v241-2022-10-03) [Compare Source](https://togithub.com/googleapis/java-language/compare/v2.4.0...v2.4.1) ##### Documentation - Update classification sample to use v2 model ([#​899](https://togithub.com/googleapis/java-language/issues/899)) ([7b3a5f8](https://togithub.com/googleapis/java-language/commit/7b3a5f86b7de401198e74e76ba7af1f1599ae6cc)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#​929](https://togithub.com/googleapis/java-language/issues/929)) ([805563b](https://togithub.com/googleapis/java-language/commit/805563b083bb04bfa59ef7fc4418c6950b3340db)) - Update dependency google-api-core to v2.10.1 ([#​921](https://togithub.com/googleapis/java-language/issues/921)) ([8b39a51](https://togithub.com/googleapis/java-language/commit/8b39a51acbc452afc2bb045f6d88bbdfc46b81ed)) - Update dependency google-auth to v2.12.0 ([#​922](https://togithub.com/googleapis/java-language/issues/922)) ([f273003](https://togithub.com/googleapis/java-language/commit/f273003a294fb2d116c78f25848bd22fa8f18fc8)) - Update dependency google-cloud-storage to v2.5.0 ([#​923](https://togithub.com/googleapis/java-language/issues/923)) ([c34885b](https://togithub.com/googleapis/java-language/commit/c34885ba6ad41c8eeeeda2ad9feb20f89f67e589)) - Update dependency google-crc32c to v1.5.0 ([#​924](https://togithub.com/googleapis/java-language/issues/924)) ([51baceb](https://togithub.com/googleapis/java-language/commit/51baceb6bf821f3da41569b27cd7cdf745bd1db8)) - Update dependency importlib-metadata to v4.12.0 ([#​925](https://togithub.com/googleapis/java-language/issues/925)) ([a246f0d](https://togithub.com/googleapis/java-language/commit/a246f0dcc43ce8faeefdf998011222df294d27fa)) - Update dependency jeepney to v0.8.0 ([#​926](https://togithub.com/googleapis/java-language/issues/926)) ([04a307a](https://togithub.com/googleapis/java-language/commit/04a307ad130c3adfb2471aac551ebfc674c0d060))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0814c06d..779abe22 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-language - 2.4.0 + 2.4.1 ``` @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-language' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.4.0' +implementation 'com.google.cloud:google-cloud-language:2.4.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.4.0" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.4.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0a06cbf2..8042e8dc 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-language - 2.4.0 + 2.4.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0d431ed2..6e6f9a7d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-language - 2.4.0 + 2.4.1 From 4fd68f1dbcc279a3aa9d9695106846666109b65b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 7 Oct 2022 20:06:27 +0200 Subject: [PATCH 32/43] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.3 (#932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.2` -> `26.1.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/compatibility-slim/26.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/confidence-slim/26.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 4 ++-- samples/snippets/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 779abe22..9bb83917 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.1.2 + 26.1.3 pom import @@ -49,7 +49,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.2') +implementation platform('com.google.cloud:libraries-bom:26.1.3') implementation 'com.google.cloud:google-cloud-language' ``` diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2dc175bf..bd87cfd7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 26.1.2 + 26.1.3 pom import From cd27066aeb8697d1a0c2b930d2fbac48edd7fc61 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 21:48:37 +0000 Subject: [PATCH 33/43] chore(java): add a note in README for migrated split repos (#1687) (#950) * chore(java): add a note in README for migrated split repos Disable renovate bot and flaky bot for split repositories that have moved to the Java monorepo. The Java monorepo will pass the "monorepo=True" parameter to java.common_templates method in its owlbot.py files so that the migration note will not appear in the README in the monorepo. Co-authored-by: Jeff Ching Source-Link: https://togithub.com/googleapis/synthtool/commit/d4b291604f148cde065838c498bc8aa79b8dc10e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:edae91ccdd2dded2f572ec341a768ad180305a3e8fbfd93064b28e237d35920a --- .github/.OwlBot.lock.yaml | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 5 +++ .github/ISSUE_TEMPLATE/feature_request.md | 5 +++ .kokoro/dependencies.sh | 51 ----------------------- .kokoro/nightly/integration.cfg | 2 +- .kokoro/nightly/java11-integration.cfg | 2 +- .kokoro/nightly/samples.cfg | 2 +- .kokoro/requirements.in | 2 + .kokoro/requirements.txt | 14 ++++--- README.md | 13 ++++-- renovate.json | 1 + 11 files changed, 36 insertions(+), 63 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 42327db5..77cf6087 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 + digest: sha256:edae91ccdd2dded2f572ec341a768ad180305a3e8fbfd93064b28e237d35920a diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b138d890..bfa0d3df 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,6 +4,11 @@ about: Create a report to help us improve --- +:bus: This library has moved to +[google-cloud-java/java-language]( +https://github.com/googleapis/google-cloud-java/tree/main/java-language). +This repository will be archived in the future. + Thanks for stopping by to let us know something could be better! **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 754e30c6..eee02c5e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,6 +4,11 @@ about: Suggest an idea for this library --- +:bus: This library has moved to +[google-cloud-java/java-language]( +https://github.com/googleapis/google-cloud-java/tree/main/java-language). +This repository will be archived in the future. + Thanks for stopping by to let us know something could be better! **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index d7476cfe..bd896024 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -57,54 +57,3 @@ retry_with_backoff 3 10 \ -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true - -echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" -## Run dependency list completeness check -function completenessCheck() { - # Output dep list with compile scope generated using the original pom - # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. - # This is stripped from the output as it is not present in the flattened pom. - # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. - msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt - - # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) - msg "Generating dependency list using flattened pom..." - mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt - - # Compare two dependency lists - msg "Comparing dependency lists..." - diff .org-list.txt .new-list.txt >.diff.txt - if [[ $? == 0 ]] - then - msg "Success. No diff!" - else - msg "Diff found. See below: " - msg "You can also check .diff.txt file located in $1." - cat .diff.txt - return 1 - fi -} - -# Allow failures to continue running the script -set +e - -error_count=0 -for path in **/.flattened-pom.xml -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index a2907a25..bd0297a3 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -23,7 +23,7 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } env_vars: { diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg index 58049cc3..dc51b65e 100644 --- a/.kokoro/nightly/java11-integration.cfg +++ b/.kokoro/nightly/java11-integration.cfg @@ -23,7 +23,7 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } env_vars: { diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index 9761fd86..fee6a838 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index cfdc2e7e..6aa7cf2b 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -16,10 +16,12 @@ pycparser==2.21 pyperclip==1.8.2 python-dateutil==2.8.2 requests==2.27.1 +certifi==2022.9.24 importlib-metadata==4.8.3 zipp==3.6.0 google_api_core==2.8.2 google-cloud-storage==2.0.0 +google-resumable-media==2.3.3 google-cloud-core==2.3.1 typing-extensions==4.1.1 urllib3==1.26.12 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 170f1c63..02ae42bb 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -16,10 +16,12 @@ cachetools==4.2.4 \ # via # -r requirements.in # google-auth -certifi==2022.9.14 \ - --hash=sha256:36973885b9542e6bd01dea287b2b4b3b21236307c56324fcc3f1160f2d655ed5 \ - --hash=sha256:e232343de1ab72c2aa521b625c80f699e356830fd0e2c620b465b304b17b0516 - # via requests +certifi==2022.9.24 \ + --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ + --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 + # via + # -r requirements.in + # requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ @@ -218,7 +220,9 @@ google-crc32c==1.3.0 \ google-resumable-media==2.3.3 \ --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via google-cloud-storage + # via + # -r requirements.in + # google-cloud-storage googleapis-common-protos==1.56.3 \ --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 diff --git a/README.md b/README.md index 9bb83917..6b52e0c3 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,13 @@ Java idiomatic client for [Natural Language][product-docs]. - [Client Library Documentation][javadocs] +:bus: In October 2022, this library has moved to +[google-cloud-java/java-language]( +https://github.com/googleapis/google-cloud-java/tree/main/java-language). +This repository will be archived in the future. +Future releases will appear in the new repository (https://github.com/googleapis/google-cloud-java/releases). +The Maven artifact coordinates (`com.google.cloud:google-cloud-language`) remain the same. + ## Quickstart If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: @@ -49,20 +56,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.3') +implementation platform('com.google.cloud:libraries-bom:26.1.4') implementation 'com.google.cloud:google-cloud-language' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.4.1' +implementation 'com.google.cloud:google-cloud-language:2.6.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.4.1" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.6.0" ``` ## Authentication diff --git a/renovate.json b/renovate.json index 39515cf3..621ec34f 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,5 @@ { + "enabled": false, "extends": [ ":separateMajorReleases", ":combinePatchMinorReleases", From 0bedf16ff315b97487f5e3000b366e7efd340c0b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 17:32:24 +0000 Subject: [PATCH 34/43] chore: Set `rest_numeric_enums = False` for all gapic rules explicitly (#948) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 485623855 Source-Link: https://togithub.com/googleapis/googleapis/commit/807125e7953e32535710924fe4bf0362ac93754d Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c4ddd6d651da69658a4762c5eafff5cd8f0e25c5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzRkZGQ2ZDY1MWRhNjk2NThhNDc2MmM1ZWFmZmY1Y2Q4ZjBlMjVjNSJ9 --- .../google/cloud/language/v1/LanguageServiceClient.java | 5 +---- .../cloud/language/v1beta2/LanguageServiceClient.java | 5 +---- .../analyzeentities/AsyncAnalyzeEntities.java | 4 ++-- .../analyzeentities/SyncAnalyzeEntities.java | 4 ++-- .../analyzeentities/SyncAnalyzeEntitiesDocument.java | 4 ++-- .../SyncAnalyzeEntitiesDocumentEncodingtype.java | 4 ++-- .../AsyncAnalyzeEntitySentiment.java | 4 ++-- .../SyncAnalyzeEntitySentiment.java | 4 ++-- .../SyncAnalyzeEntitySentimentDocument.java | 4 ++-- .../SyncAnalyzeEntitySentimentDocumentEncodingtype.java | 4 ++-- .../analyzesentiment/AsyncAnalyzeSentiment.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentiment.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentimentDocument.java | 4 ++-- .../SyncAnalyzeSentimentDocumentEncodingtype.java | 4 ++-- .../analyzesyntax/AsyncAnalyzeSyntax.java | 4 ++-- .../analyzesyntax/SyncAnalyzeSyntax.java | 4 ++-- .../analyzesyntax/SyncAnalyzeSyntaxDocument.java | 4 ++-- .../SyncAnalyzeSyntaxDocumentEncodingtype.java | 4 ++-- .../annotatetext/AsyncAnnotateText.java | 4 ++-- .../annotatetext/SyncAnnotateText.java | 4 ++-- ...cAnnotateTextDocumentAnnotatetextrequestfeatures.java | 4 ++-- ...tDocumentAnnotatetextrequestfeaturesEncodingtype.java | 4 ++-- .../classifytext/AsyncClassifyText.java | 4 ++-- .../classifytext/SyncClassifyText.java | 4 ++-- .../classifytext/SyncClassifyTextDocument.java | 4 ++-- .../create/SyncCreateSetCredentialsProvider.java | 4 ++-- .../create/SyncCreateSetCredentialsProvider1.java | 9 +++------ .../create/SyncCreateSetEndpoint.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentiment.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentiment.java | 4 ++-- .../analyzeentities/AsyncAnalyzeEntities.java | 4 ++-- .../analyzeentities/SyncAnalyzeEntities.java | 4 ++-- .../analyzeentities/SyncAnalyzeEntitiesDocument.java | 4 ++-- .../SyncAnalyzeEntitiesDocumentEncodingtype.java | 4 ++-- .../AsyncAnalyzeEntitySentiment.java | 4 ++-- .../SyncAnalyzeEntitySentiment.java | 4 ++-- .../SyncAnalyzeEntitySentimentDocument.java | 4 ++-- .../SyncAnalyzeEntitySentimentDocumentEncodingtype.java | 4 ++-- .../analyzesentiment/AsyncAnalyzeSentiment.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentiment.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentimentDocument.java | 4 ++-- .../SyncAnalyzeSentimentDocumentEncodingtype.java | 4 ++-- .../analyzesyntax/AsyncAnalyzeSyntax.java | 4 ++-- .../analyzesyntax/SyncAnalyzeSyntax.java | 4 ++-- .../analyzesyntax/SyncAnalyzeSyntaxDocument.java | 4 ++-- .../SyncAnalyzeSyntaxDocumentEncodingtype.java | 4 ++-- .../annotatetext/AsyncAnnotateText.java | 4 ++-- .../annotatetext/SyncAnnotateText.java | 4 ++-- ...cAnnotateTextDocumentAnnotatetextrequestfeatures.java | 4 ++-- ...tDocumentAnnotatetextrequestfeaturesEncodingtype.java | 4 ++-- .../classifytext/AsyncClassifyText.java | 4 ++-- .../classifytext/SyncClassifyText.java | 4 ++-- .../classifytext/SyncClassifyTextDocument.java | 4 ++-- .../create/SyncCreateSetCredentialsProvider.java | 4 ++-- .../create/SyncCreateSetCredentialsProvider1.java | 9 +++------ .../create/SyncCreateSetEndpoint.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentiment.java | 4 ++-- .../analyzesentiment/SyncAnalyzeSentiment.java | 4 ++-- 58 files changed, 116 insertions(+), 128 deletions(-) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentities/AsyncAnalyzeEntities.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentities/SyncAnalyzeEntities.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentities/SyncAnalyzeEntitiesDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesentiment/AsyncAnalyzeSentiment.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesentiment/SyncAnalyzeSentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesentiment/SyncAnalyzeSentimentDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesyntax/AsyncAnalyzeSyntax.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesyntax/SyncAnalyzeSyntax.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesyntax/SyncAnalyzeSyntaxDocument.java (91%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/annotatetext/AsyncAnnotateText.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/annotatetext/SyncAnnotateText.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java (89%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java (89%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/classifytext/AsyncClassifyText.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/classifytext/SyncClassifyText.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/classifytext/SyncClassifyTextDocument.java (91%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/create/SyncCreateSetCredentialsProvider.java (91%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/create/SyncCreateSetCredentialsProvider1.java (80%) rename samples/snippets/generated/com/google/cloud/language/v1/{languageserviceclient => languageservice}/create/SyncCreateSetEndpoint.java (91%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentities/AsyncAnalyzeEntities.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentities/SyncAnalyzeEntities.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentities/SyncAnalyzeEntitiesDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java (89%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesentiment/AsyncAnalyzeSentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesentiment/SyncAnalyzeSentiment.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesentiment/SyncAnalyzeSentimentDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesyntax/AsyncAnalyzeSyntax.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesyntax/SyncAnalyzeSyntax.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesyntax/SyncAnalyzeSyntaxDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/annotatetext/AsyncAnnotateText.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/annotatetext/SyncAnnotateText.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java (89%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java (89%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/classifytext/AsyncClassifyText.java (93%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/classifytext/SyncClassifyText.java (92%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/classifytext/SyncClassifyTextDocument.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/create/SyncCreateSetCredentialsProvider.java (90%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/create/SyncCreateSetCredentialsProvider1.java (80%) rename samples/snippets/generated/com/google/cloud/language/v1beta2/{languageserviceclient => languageservice}/create/SyncCreateSetEndpoint.java (91%) diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java index f5c952be..dd726dd4 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java @@ -111,10 +111,7 @@ * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * LanguageServiceSettings languageServiceSettings = - * LanguageServiceSettings.newBuilder() - * .setTransportChannelProvider( - * LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) - * .build(); + * LanguageServiceSettings.newHttpJsonBuilder().build(); * LanguageServiceClient languageServiceClient = * LanguageServiceClient.create(languageServiceSettings); * }
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java index 48573abc..ca3318fc 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java @@ -112,10 +112,7 @@ * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * LanguageServiceSettings languageServiceSettings = - * LanguageServiceSettings.newBuilder() - * .setTransportChannelProvider( - * LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) - * .build(); + * LanguageServiceSettings.newHttpJsonBuilder().build(); * LanguageServiceClient languageServiceClient = * LanguageServiceClient.create(languageServiceSettings); * }
diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/AsyncAnalyzeEntities.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/AsyncAnalyzeEntities.java index f35e1201..a251209b 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/AsyncAnalyzeEntities.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentities_async] +// [START language_v1_generated_LanguageService_AnalyzeEntities_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1.AnalyzeEntitiesRequest; import com.google.cloud.language.v1.AnalyzeEntitiesResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeEntities() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentities_async] +// [END language_v1_generated_LanguageService_AnalyzeEntities_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntities.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntities.java index 1b641f00..23c991c6 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntities.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentities_sync] +// [START language_v1_generated_LanguageService_AnalyzeEntities_sync] import com.google.cloud.language.v1.AnalyzeEntitiesRequest; import com.google.cloud.language.v1.AnalyzeEntitiesResponse; import com.google.cloud.language.v1.Document; @@ -45,4 +45,4 @@ public static void syncAnalyzeEntities() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentities_sync] +// [END language_v1_generated_LanguageService_AnalyzeEntities_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java index 7c06cfc8..9248458b 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentities_document_sync] +// [START language_v1_generated_LanguageService_AnalyzeEntities_Document_sync] import com.google.cloud.language.v1.AnalyzeEntitiesResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncAnalyzeEntitiesDocument() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentities_document_sync] +// [END language_v1_generated_LanguageService_AnalyzeEntities_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java index c249d1b4..c28e4c49 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentities_documentencodingtype_sync] +// [START language_v1_generated_LanguageService_AnalyzeEntities_DocumentEncodingtype_sync] import com.google.cloud.language.v1.AnalyzeEntitiesResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.EncodingType; @@ -42,4 +42,4 @@ public static void syncAnalyzeEntitiesDocumentEncodingtype() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentities_documentencodingtype_sync] +// [END language_v1_generated_LanguageService_AnalyzeEntities_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java index 771ae366..cd1073c0 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_async] +// [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeEntitySentiment() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_async] +// [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java index 00e55c62..05683d67 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_sync] +// [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_sync] import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; import com.google.cloud.language.v1.Document; @@ -46,4 +46,4 @@ public static void syncAnalyzeEntitySentiment() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_sync] +// [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java index fc6505eb..13b4ffc9 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_document_sync] +// [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_Document_sync] import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.LanguageServiceClient; @@ -40,4 +40,4 @@ public static void syncAnalyzeEntitySentimentDocument() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_document_sync] +// [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java index 4bd8bbd3..13981a2d 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzeentitysentiment_documentencodingtype_sync] +// [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_DocumentEncodingtype_sync] import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.EncodingType; @@ -42,4 +42,4 @@ public static void syncAnalyzeEntitySentimentDocumentEncodingtype() throws Excep } } } -// [END language_v1_generated_languageserviceclient_analyzeentitysentiment_documentencodingtype_sync] +// [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java index 1224abdd..3510365f 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesentiment_async] +// [START language_v1_generated_LanguageService_AnalyzeSentiment_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1.AnalyzeSentimentRequest; import com.google.cloud.language.v1.AnalyzeSentimentResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeSentiment() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesentiment_async] +// [END language_v1_generated_LanguageService_AnalyzeSentiment_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentiment.java index fc5b5f9f..0c7876c7 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesentiment_sync] +// [START language_v1_generated_LanguageService_AnalyzeSentiment_sync] import com.google.cloud.language.v1.AnalyzeSentimentRequest; import com.google.cloud.language.v1.AnalyzeSentimentResponse; import com.google.cloud.language.v1.Document; @@ -45,4 +45,4 @@ public static void syncAnalyzeSentiment() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesentiment_sync] +// [END language_v1_generated_LanguageService_AnalyzeSentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java index 5fc0ab6b..f71f3400 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesentiment_document_sync] +// [START language_v1_generated_LanguageService_AnalyzeSentiment_Document_sync] import com.google.cloud.language.v1.AnalyzeSentimentResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncAnalyzeSentimentDocument() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesentiment_document_sync] +// [END language_v1_generated_LanguageService_AnalyzeSentiment_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java index 9baa8e4f..085a2c4f 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesentiment_documentencodingtype_sync] +// [START language_v1_generated_LanguageService_AnalyzeSentiment_DocumentEncodingtype_sync] import com.google.cloud.language.v1.AnalyzeSentimentResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.EncodingType; @@ -42,4 +42,4 @@ public static void syncAnalyzeSentimentDocumentEncodingtype() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesentiment_documentencodingtype_sync] +// [END language_v1_generated_LanguageService_AnalyzeSentiment_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java index ea72f04b..d9f21c0b 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesyntax_async] +// [START language_v1_generated_LanguageService_AnalyzeSyntax_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1.AnalyzeSyntaxRequest; import com.google.cloud.language.v1.AnalyzeSyntaxResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeSyntax() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesyntax_async] +// [END language_v1_generated_LanguageService_AnalyzeSyntax_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntax.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntax.java index 34e80427..41fc1e2d 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntax.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesyntax_sync] +// [START language_v1_generated_LanguageService_AnalyzeSyntax_sync] import com.google.cloud.language.v1.AnalyzeSyntaxRequest; import com.google.cloud.language.v1.AnalyzeSyntaxResponse; import com.google.cloud.language.v1.Document; @@ -45,4 +45,4 @@ public static void syncAnalyzeSyntax() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesyntax_sync] +// [END language_v1_generated_LanguageService_AnalyzeSyntax_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java similarity index 91% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java index 282e8557..e02c98d9 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesyntax_document_sync] +// [START language_v1_generated_LanguageService_AnalyzeSyntax_Document_sync] import com.google.cloud.language.v1.AnalyzeSyntaxResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncAnalyzeSyntaxDocument() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesyntax_document_sync] +// [END language_v1_generated_LanguageService_AnalyzeSyntax_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java index fdeab0b6..4c5b51e5 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_analyzesyntax_documentencodingtype_sync] +// [START language_v1_generated_LanguageService_AnalyzeSyntax_DocumentEncodingtype_sync] import com.google.cloud.language.v1.AnalyzeSyntaxResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.EncodingType; @@ -41,4 +41,4 @@ public static void syncAnalyzeSyntaxDocumentEncodingtype() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_analyzesyntax_documentencodingtype_sync] +// [END language_v1_generated_LanguageService_AnalyzeSyntax_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/AsyncAnnotateText.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/AsyncAnnotateText.java index 8bcc06e7..54deb8a2 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/AsyncAnnotateText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/AsyncAnnotateText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_annotatetext_async] +// [START language_v1_generated_LanguageService_AnnotateText_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1.AnnotateTextRequest; import com.google.cloud.language.v1.AnnotateTextResponse; @@ -50,4 +50,4 @@ public static void asyncAnnotateText() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_annotatetext_async] +// [END language_v1_generated_LanguageService_AnnotateText_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateText.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateText.java index 47245674..7e2e1ff5 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_annotatetext_sync] +// [START language_v1_generated_LanguageService_AnnotateText_sync] import com.google.cloud.language.v1.AnnotateTextRequest; import com.google.cloud.language.v1.AnnotateTextResponse; import com.google.cloud.language.v1.Document; @@ -46,4 +46,4 @@ public static void syncAnnotateText() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_annotatetext_sync] +// [END language_v1_generated_LanguageService_AnnotateText_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java similarity index 89% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java index b78e84ad..fe79bf7c 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeatures_sync] +// [START language_v1_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeatures_sync] import com.google.cloud.language.v1.AnnotateTextRequest; import com.google.cloud.language.v1.AnnotateTextResponse; import com.google.cloud.language.v1.Document; @@ -41,4 +41,4 @@ public static void syncAnnotateTextDocumentAnnotatetextrequestfeatures() throws } } } -// [END language_v1_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeatures_sync] +// [END language_v1_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeatures_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java similarity index 89% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java index 261a6b4d..3bed5c8b 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeaturesencodingtype_sync] +// [START language_v1_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeaturesEncodingtype_sync] import com.google.cloud.language.v1.AnnotateTextRequest; import com.google.cloud.language.v1.AnnotateTextResponse; import com.google.cloud.language.v1.Document; @@ -45,4 +45,4 @@ public static void syncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingty } } } -// [END language_v1_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeaturesencodingtype_sync] +// [END language_v1_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeaturesEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/AsyncClassifyText.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/AsyncClassifyText.java index 5d351f77..00096a42 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/AsyncClassifyText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_classifytext_async] +// [START language_v1_generated_LanguageService_ClassifyText_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1.ClassificationModelOptions; import com.google.cloud.language.v1.ClassifyTextRequest; @@ -49,4 +49,4 @@ public static void asyncClassifyText() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_classifytext_async] +// [END language_v1_generated_LanguageService_ClassifyText_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyText.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyText.java index b319f8a6..b61b572e 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_classifytext_sync] +// [START language_v1_generated_LanguageService_ClassifyText_sync] import com.google.cloud.language.v1.ClassificationModelOptions; import com.google.cloud.language.v1.ClassifyTextRequest; import com.google.cloud.language.v1.ClassifyTextResponse; @@ -45,4 +45,4 @@ public static void syncClassifyText() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_classifytext_sync] +// [END language_v1_generated_LanguageService_ClassifyText_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyTextDocument.java similarity index 91% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyTextDocument.java index 93665252..29548c35 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyTextDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyTextDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_classifytext_document_sync] +// [START language_v1_generated_LanguageService_ClassifyText_Document_sync] import com.google.cloud.language.v1.ClassifyTextResponse; import com.google.cloud.language.v1.Document; import com.google.cloud.language.v1.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncClassifyTextDocument() throws Exception { } } } -// [END language_v1_generated_languageserviceclient_classifytext_document_sync] +// [END language_v1_generated_LanguageService_ClassifyText_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider.java similarity index 91% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider.java index 8e0ac427..2c5c8237 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_create_setcredentialsprovider_sync] +// [START language_v1_generated_LanguageService_Create_SetCredentialsProvider_sync] import com.google.api.gax.core.FixedCredentialsProvider; import com.google.cloud.language.v1.LanguageServiceClient; import com.google.cloud.language.v1.LanguageServiceSettings; @@ -42,4 +42,4 @@ public static void syncCreateSetCredentialsProvider() throws Exception { LanguageServiceClient.create(languageServiceSettings); } } -// [END language_v1_generated_languageserviceclient_create_setcredentialsprovider_sync] +// [END language_v1_generated_LanguageService_Create_SetCredentialsProvider_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider1.java similarity index 80% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider1.java index 3ad70bd4..8e192062 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider1.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_create_setcredentialsprovider1_sync] +// [START language_v1_generated_LanguageService_Create_SetCredentialsProvider1_sync] import com.google.cloud.language.v1.LanguageServiceClient; import com.google.cloud.language.v1.LanguageServiceSettings; @@ -33,12 +33,9 @@ public static void syncCreateSetCredentialsProvider1() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library LanguageServiceSettings languageServiceSettings = - LanguageServiceSettings.newBuilder() - .setTransportChannelProvider( - LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) - .build(); + LanguageServiceSettings.newHttpJsonBuilder().build(); LanguageServiceClient languageServiceClient = LanguageServiceClient.create(languageServiceSettings); } } -// [END language_v1_generated_languageserviceclient_create_setcredentialsprovider1_sync] +// [END language_v1_generated_LanguageService_Create_SetCredentialsProvider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetEndpoint.java similarity index 91% rename from samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java rename to samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetEndpoint.java index bc6d0712..027afc7d 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/create/SyncCreateSetEndpoint.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetEndpoint.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageserviceclient_create_setendpoint_sync] +// [START language_v1_generated_LanguageService_Create_SetEndpoint_sync] import com.google.cloud.language.v1.LanguageServiceClient; import com.google.cloud.language.v1.LanguageServiceSettings; import com.google.cloud.language.v1.myEndpoint; @@ -39,4 +39,4 @@ public static void syncCreateSetEndpoint() throws Exception { LanguageServiceClient.create(languageServiceSettings); } } -// [END language_v1_generated_languageserviceclient_create_setendpoint_sync] +// [END language_v1_generated_LanguageService_Create_SetEndpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java index b1989ce7..22f2d733 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.samples; -// [START language_v1_generated_languageservicesettings_analyzesentiment_sync] +// [START language_v1_generated_LanguageServiceSettings_AnalyzeSentiment_sync] import com.google.cloud.language.v1.LanguageServiceSettings; import java.time.Duration; @@ -43,4 +43,4 @@ public static void syncAnalyzeSentiment() throws Exception { LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build(); } } -// [END language_v1_generated_languageservicesettings_analyzesentiment_sync] +// [END language_v1_generated_LanguageServiceSettings_AnalyzeSentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java index 08acbeda..3ab38532 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1.stub.samples; -// [START language_v1_generated_languageservicestubsettings_analyzesentiment_sync] +// [START language_v1_generated_LanguageServiceStubSettings_AnalyzeSentiment_sync] import com.google.cloud.language.v1.stub.LanguageServiceStubSettings; import java.time.Duration; @@ -43,4 +43,4 @@ public static void syncAnalyzeSentiment() throws Exception { LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build(); } } -// [END language_v1_generated_languageservicestubsettings_analyzesentiment_sync] +// [END language_v1_generated_LanguageServiceStubSettings_AnalyzeSentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/AsyncAnalyzeEntities.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/AsyncAnalyzeEntities.java index 1a1f9409..916d10bf 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/AsyncAnalyzeEntities.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/AsyncAnalyzeEntities.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentities_async] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntities_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest; import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeEntities() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentities_async] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntities_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntities.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntities.java index 901012a5..1be324b0 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntities.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntities.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentities_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntities_sync] import com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest; import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; import com.google.cloud.language.v1beta2.Document; @@ -45,4 +45,4 @@ public static void syncAnalyzeEntities() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentities_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntities_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java index f08af4b7..3324fd84 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentities_document_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntities_Document_sync] import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncAnalyzeEntitiesDocument() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentities_document_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntities_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java index 89bc7669..84cdf0cd 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentities_documentencodingtype_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntities_DocumentEncodingtype_sync] import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.EncodingType; @@ -42,4 +42,4 @@ public static void syncAnalyzeEntitiesDocumentEncodingtype() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentities_documentencodingtype_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntities_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java index 3b053866..3e1b2e60 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_async] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeEntitySentiment() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_async] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java index baf5711f..af3c95bd 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_sync] import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; import com.google.cloud.language.v1beta2.Document; @@ -46,4 +46,4 @@ public static void syncAnalyzeEntitySentiment() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java index 2df99ec2..2d4be5f4 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_document_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_Document_sync] import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.LanguageServiceClient; @@ -40,4 +40,4 @@ public static void syncAnalyzeEntitySentimentDocument() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_document_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java similarity index 89% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java index 3bfbf272..f0f75f65 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_documentencodingtype_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_DocumentEncodingtype_sync] import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.EncodingType; @@ -42,4 +42,4 @@ public static void syncAnalyzeEntitySentimentDocumentEncodingtype() throws Excep } } } -// [END language_v1beta2_generated_languageserviceclient_analyzeentitysentiment_documentencodingtype_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java index aeb1e8ae..391b43a2 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/AsyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesentiment_async] +// [START language_v1beta2_generated_LanguageService_AnalyzeSentiment_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1beta2.AnalyzeSentimentRequest; import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeSentiment() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesentiment_async] +// [END language_v1beta2_generated_LanguageService_AnalyzeSentiment_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentiment.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentiment.java index 4c5f7e4e..3029e542 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesentiment_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeSentiment_sync] import com.google.cloud.language.v1beta2.AnalyzeSentimentRequest; import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; import com.google.cloud.language.v1beta2.Document; @@ -45,4 +45,4 @@ public static void syncAnalyzeSentiment() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesentiment_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeSentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java index bbc5d8c2..abffa8c8 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesentiment_document_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeSentiment_Document_sync] import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncAnalyzeSentimentDocument() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesentiment_document_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeSentiment_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java index cb710a70..a58cd5d9 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesentiment_documentencodingtype_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeSentiment_DocumentEncodingtype_sync] import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.EncodingType; @@ -42,4 +42,4 @@ public static void syncAnalyzeSentimentDocumentEncodingtype() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesentiment_documentencodingtype_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeSentiment_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java index f5eee930..a377ec67 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/AsyncAnalyzeSyntax.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesyntax_async] +// [START language_v1beta2_generated_LanguageService_AnalyzeSyntax_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest; import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; @@ -49,4 +49,4 @@ public static void asyncAnalyzeSyntax() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesyntax_async] +// [END language_v1beta2_generated_LanguageService_AnalyzeSyntax_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntax.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntax.java index 9254f4a5..fcb7fb1e 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntax.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntax.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesyntax_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeSyntax_sync] import com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest; import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; import com.google.cloud.language.v1beta2.Document; @@ -45,4 +45,4 @@ public static void syncAnalyzeSyntax() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesyntax_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeSyntax_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java index 2332236d..38e8956d 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesyntax_document_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeSyntax_Document_sync] import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncAnalyzeSyntaxDocument() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesyntax_document_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeSyntax_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java index ebc18f5a..72bce897 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_analyzesyntax_documentencodingtype_sync] +// [START language_v1beta2_generated_LanguageService_AnalyzeSyntax_DocumentEncodingtype_sync] import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.EncodingType; @@ -41,4 +41,4 @@ public static void syncAnalyzeSyntaxDocumentEncodingtype() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_analyzesyntax_documentencodingtype_sync] +// [END language_v1beta2_generated_LanguageService_AnalyzeSyntax_DocumentEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/AsyncAnnotateText.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/AsyncAnnotateText.java index 3d38a4d9..03202957 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/AsyncAnnotateText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/AsyncAnnotateText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_annotatetext_async] +// [START language_v1beta2_generated_LanguageService_AnnotateText_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1beta2.AnnotateTextRequest; import com.google.cloud.language.v1beta2.AnnotateTextResponse; @@ -50,4 +50,4 @@ public static void asyncAnnotateText() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_annotatetext_async] +// [END language_v1beta2_generated_LanguageService_AnnotateText_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateText.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateText.java index 078c2aec..bbd06b6a 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_annotatetext_sync] +// [START language_v1beta2_generated_LanguageService_AnnotateText_sync] import com.google.cloud.language.v1beta2.AnnotateTextRequest; import com.google.cloud.language.v1beta2.AnnotateTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -46,4 +46,4 @@ public static void syncAnnotateText() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_annotatetext_sync] +// [END language_v1beta2_generated_LanguageService_AnnotateText_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java similarity index 89% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java index fdefd09b..2a26c3bd 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeatures_sync] +// [START language_v1beta2_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeatures_sync] import com.google.cloud.language.v1beta2.AnnotateTextRequest; import com.google.cloud.language.v1beta2.AnnotateTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -41,4 +41,4 @@ public static void syncAnnotateTextDocumentAnnotatetextrequestfeatures() throws } } } -// [END language_v1beta2_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeatures_sync] +// [END language_v1beta2_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeatures_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java similarity index 89% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java index 8087f31b..ad254ccc 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeaturesencodingtype_sync] +// [START language_v1beta2_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeaturesEncodingtype_sync] import com.google.cloud.language.v1beta2.AnnotateTextRequest; import com.google.cloud.language.v1beta2.AnnotateTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -45,4 +45,4 @@ public static void syncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingty } } } -// [END language_v1beta2_generated_languageserviceclient_annotatetext_documentannotatetextrequestfeaturesencodingtype_sync] +// [END language_v1beta2_generated_LanguageService_AnnotateText_DocumentAnnotatetextrequestfeaturesEncodingtype_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/AsyncClassifyText.java similarity index 93% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/AsyncClassifyText.java index 7eeee4a8..1a286941 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/AsyncClassifyText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_classifytext_async] +// [START language_v1beta2_generated_LanguageService_ClassifyText_async] import com.google.api.core.ApiFuture; import com.google.cloud.language.v1beta2.ClassificationModelOptions; import com.google.cloud.language.v1beta2.ClassifyTextRequest; @@ -49,4 +49,4 @@ public static void asyncClassifyText() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_classifytext_async] +// [END language_v1beta2_generated_LanguageService_ClassifyText_async] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyText.java similarity index 92% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyText.java index 9d74f92b..e97e6131 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyText.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_classifytext_sync] +// [START language_v1beta2_generated_LanguageService_ClassifyText_sync] import com.google.cloud.language.v1beta2.ClassificationModelOptions; import com.google.cloud.language.v1beta2.ClassifyTextRequest; import com.google.cloud.language.v1beta2.ClassifyTextResponse; @@ -45,4 +45,4 @@ public static void syncClassifyText() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_classifytext_sync] +// [END language_v1beta2_generated_LanguageService_ClassifyText_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyTextDocument.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyTextDocument.java index 94af5ca8..8271b1a1 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyTextDocument.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyTextDocument.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_classifytext_document_sync] +// [START language_v1beta2_generated_LanguageService_ClassifyText_Document_sync] import com.google.cloud.language.v1beta2.ClassifyTextResponse; import com.google.cloud.language.v1beta2.Document; import com.google.cloud.language.v1beta2.LanguageServiceClient; @@ -39,4 +39,4 @@ public static void syncClassifyTextDocument() throws Exception { } } } -// [END language_v1beta2_generated_languageserviceclient_classifytext_document_sync] +// [END language_v1beta2_generated_LanguageService_ClassifyText_Document_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider.java similarity index 90% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider.java index bddd0d4f..a24a9947 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_create_setcredentialsprovider_sync] +// [START language_v1beta2_generated_LanguageService_Create_SetCredentialsProvider_sync] import com.google.api.gax.core.FixedCredentialsProvider; import com.google.cloud.language.v1beta2.LanguageServiceClient; import com.google.cloud.language.v1beta2.LanguageServiceSettings; @@ -42,4 +42,4 @@ public static void syncCreateSetCredentialsProvider() throws Exception { LanguageServiceClient.create(languageServiceSettings); } } -// [END language_v1beta2_generated_languageserviceclient_create_setcredentialsprovider_sync] +// [END language_v1beta2_generated_LanguageService_Create_SetCredentialsProvider_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider1.java similarity index 80% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider1.java index 5da25c5b..8e6a74a9 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetCredentialsProvider1.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider1.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_create_setcredentialsprovider1_sync] +// [START language_v1beta2_generated_LanguageService_Create_SetCredentialsProvider1_sync] import com.google.cloud.language.v1beta2.LanguageServiceClient; import com.google.cloud.language.v1beta2.LanguageServiceSettings; @@ -33,12 +33,9 @@ public static void syncCreateSetCredentialsProvider1() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library LanguageServiceSettings languageServiceSettings = - LanguageServiceSettings.newBuilder() - .setTransportChannelProvider( - LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) - .build(); + LanguageServiceSettings.newHttpJsonBuilder().build(); LanguageServiceClient languageServiceClient = LanguageServiceClient.create(languageServiceSettings); } } -// [END language_v1beta2_generated_languageserviceclient_create_setcredentialsprovider1_sync] +// [END language_v1beta2_generated_LanguageService_Create_SetCredentialsProvider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetEndpoint.java similarity index 91% rename from samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java rename to samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetEndpoint.java index b8feb4d3..b4420930 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/create/SyncCreateSetEndpoint.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetEndpoint.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageserviceclient_create_setendpoint_sync] +// [START language_v1beta2_generated_LanguageService_Create_SetEndpoint_sync] import com.google.cloud.language.v1beta2.LanguageServiceClient; import com.google.cloud.language.v1beta2.LanguageServiceSettings; import com.google.cloud.language.v1beta2.myEndpoint; @@ -39,4 +39,4 @@ public static void syncCreateSetEndpoint() throws Exception { LanguageServiceClient.create(languageServiceSettings); } } -// [END language_v1beta2_generated_languageserviceclient_create_setendpoint_sync] +// [END language_v1beta2_generated_LanguageService_Create_SetEndpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java index 95c191fe..af458ef0 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.samples; -// [START language_v1beta2_generated_languageservicesettings_analyzesentiment_sync] +// [START language_v1beta2_generated_LanguageServiceSettings_AnalyzeSentiment_sync] import com.google.cloud.language.v1beta2.LanguageServiceSettings; import java.time.Duration; @@ -43,4 +43,4 @@ public static void syncAnalyzeSentiment() throws Exception { LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build(); } } -// [END language_v1beta2_generated_languageservicesettings_analyzesentiment_sync] +// [END language_v1beta2_generated_LanguageServiceSettings_AnalyzeSentiment_sync] diff --git a/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java b/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java index bd35369f..0e30016c 100644 --- a/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java +++ b/samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java @@ -16,7 +16,7 @@ package com.google.cloud.language.v1beta2.stub.samples; -// [START language_v1beta2_generated_languageservicestubsettings_analyzesentiment_sync] +// [START language_v1beta2_generated_LanguageServiceStubSettings_AnalyzeSentiment_sync] import com.google.cloud.language.v1beta2.stub.LanguageServiceStubSettings; import java.time.Duration; @@ -43,4 +43,4 @@ public static void syncAnalyzeSentiment() throws Exception { LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build(); } } -// [END language_v1beta2_generated_languageservicestubsettings_analyzesentiment_sync] +// [END language_v1beta2_generated_LanguageServiceStubSettings_AnalyzeSentiment_sync] From 54e65ecad95b693572b997ce5d1dd742db38a583 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Nov 2022 18:54:21 +0100 Subject: [PATCH 35/43] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.4 (#946) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.3` -> `26.1.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.4/compatibility-slim/26.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.4/confidence-slim/26.1.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b52e0c3..16ef1837 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.1.3 + 26.1.4 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bd87cfd7..fac1aad2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 26.1.3 + 26.1.4 pom import From 1f0ff46edf0f6c7c7984747c037c7bb2f3f89258 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 18 Nov 2022 16:28:15 +0100 Subject: [PATCH 36/43] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.4 (#940) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.3` -> `1.5.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.4/compatibility-slim/1.5.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.4/confidence-slim/1.5.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. πŸ”• **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-language). --- README.md | 4 ++-- google-cloud-language-bom/pom.xml | 2 +- pom.xml | 4 ++-- .../snippets/src/main/java/com/example/language/Analyze.java | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 16ef1837..d12ecbfd 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,13 @@ implementation 'com.google.cloud:google-cloud-language' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.6.0' +implementation 'com.google.cloud:google-cloud-language:2.7.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.6.0" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.7.0" ``` ## Authentication diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml index c09ad678..44e6ce47 100644 --- a/google-cloud-language-bom/pom.xml +++ b/google-cloud-language-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud google-cloud-shared-config - 1.5.3 + 1.5.4 Google Cloud language BOM diff --git a/pom.xml b/pom.xml index 305adb40..e80d5bca 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.3 + 1.5.4 @@ -87,7 +87,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.4 + 3.0.5 pom import diff --git a/samples/snippets/src/main/java/com/example/language/Analyze.java b/samples/snippets/src/main/java/com/example/language/Analyze.java index 04aaef4a..545f7ce2 100644 --- a/samples/snippets/src/main/java/com/example/language/Analyze.java +++ b/samples/snippets/src/main/java/com/example/language/Analyze.java @@ -282,7 +282,8 @@ public static void classifyText(String text) throws Exception { try (LanguageServiceClient language = LanguageServiceClient.create()) { // Set content to the text string Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - V2Model v2Model = V2Model.setContentCategoriesVersion(ContentCategoriesVersion.V2).build(); + V2Model v2Model = + V2Model.newBuilder().setContentCategoriesVersion(ContentCategoriesVersion.V2).build(); ClassificationModelOptions options = ClassificationModelOptions.newBuilder().setV2Model(v2Model).build(); ClassifyTextRequest request = From 10af2e424caff3aa47a7470ce1520281aa881cb4 Mon Sep 17 00:00:00 2001 From: Shabir Mohamed Abdul Samadh <7249208+Shabirmean@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:50:17 -0500 Subject: [PATCH 37/43] cleanup: remove migrated sample (#955) Remove the sample that was migrated in https://togithub.com/GoogleCloudPlatform/java-docs-samples/pull/7436 --- README.md | 3 - .../beta/example/language/AnalyzeBeta.java | 3 +- .../java/com/example/language/Analyze.java | 387 ------------------ .../example/language/QuickstartSample.java | 43 -- .../com/example/language/SetEndpoint.java | 50 --- .../beta/example/language/AnalyzeBetaIT.java | 3 +- .../java/com/example/language/AnalyzeIT.java | 177 -------- .../example/language/QuickstartSampleIT.java | 62 --- .../com/example/language/SetEndpointIT.java | 63 --- 9 files changed, 2 insertions(+), 789 deletions(-) delete mode 100644 samples/snippets/src/main/java/com/example/language/Analyze.java delete mode 100644 samples/snippets/src/main/java/com/example/language/QuickstartSample.java delete mode 100644 samples/snippets/src/main/java/com/example/language/SetEndpoint.java delete mode 100644 samples/snippets/src/test/java/com/example/language/AnalyzeIT.java delete mode 100644 samples/snippets/src/test/java/com/example/language/QuickstartSampleIT.java delete mode 100644 samples/snippets/src/test/java/com/example/language/SetEndpointIT.java diff --git a/README.md b/README.md index d12ecbfd..7c374324 100644 --- a/README.md +++ b/README.md @@ -146,9 +146,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-language/tree | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Analyze Beta | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java) | -| Analyze | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/com/example/language/Analyze.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/language/Analyze.java) | -| Quickstart Sample | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/com/example/language/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/language/QuickstartSample.java) | -| Set Endpoint | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/com/example/language/SetEndpoint.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/language/SetEndpoint.java) | diff --git a/samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java b/samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java index ff22eb4e..1a7aa38e 100644 --- a/samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java +++ b/samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java @@ -16,7 +16,6 @@ package beta.example.language; -import com.example.language.Analyze; import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; import com.google.cloud.language.v1beta2.ClassificationCategory; import com.google.cloud.language.v1beta2.ClassifyTextRequest; @@ -38,7 +37,7 @@ public static void main(String[] args) throws Exception { System.err.println("Usage:"); System.err.printf( "\tjava %s \"command\" \"text to analyze\" \"language\" \n", - Analyze.class.getCanonicalName()); + AnalyzeBeta.class.getCanonicalName()); System.exit(1); } String command = args[0]; diff --git a/samples/snippets/src/main/java/com/example/language/Analyze.java b/samples/snippets/src/main/java/com/example/language/Analyze.java deleted file mode 100644 index 545f7ce2..00000000 --- a/samples/snippets/src/main/java/com/example/language/Analyze.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.language; - -import com.google.cloud.language.v1.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1.AnalyzeSentimentResponse; -import com.google.cloud.language.v1.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1.ClassificationCategory; -import com.google.cloud.language.v1.ClassificationModelOptions; -import com.google.cloud.language.v1.ClassificationModelOptions.V2Model; -import com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion; -import com.google.cloud.language.v1.ClassifyTextRequest; -import com.google.cloud.language.v1.ClassifyTextResponse; -import com.google.cloud.language.v1.Document; -import com.google.cloud.language.v1.Document.Type; -import com.google.cloud.language.v1.EncodingType; -import com.google.cloud.language.v1.Entity; -import com.google.cloud.language.v1.EntityMention; -import com.google.cloud.language.v1.LanguageServiceClient; -import com.google.cloud.language.v1.Sentiment; -import com.google.cloud.language.v1.Token; -import java.util.List; -import java.util.Map; - -/** - * A sample application that uses the Natural Language API to perform entity, sentiment and syntax - * analysis. - */ -public class Analyze { - - /** Detects entities,sentiment and syntax in a document using the Natural Language API. */ - public static void main(String[] args) throws Exception { - if (args.length != 2) { - System.err.println("Usage:"); - System.err.printf( - "\tjava %s \"command\" \"text to analyze\"\n", Analyze.class.getCanonicalName()); - System.exit(1); - } - String command = args[0]; - String text = args[1]; - - if (command.equals("classify")) { - if (text.startsWith("gs://")) { - classifyFile(text); - } else { - classifyText(text); - } - } else if (command.equals("entities")) { - if (text.startsWith("gs://")) { - analyzeEntitiesFile(text); - } else { - analyzeEntitiesText(text); - } - } else if (command.equals("sentiment")) { - if (text.startsWith("gs://")) { - analyzeSentimentFile(text); - } else { - analyzeSentimentText(text); - } - } else if (command.equals("syntax")) { - if (text.startsWith("gs://")) { - analyzeSyntaxFile(text); - } else { - analyzeSyntaxText(text); - } - } else if (command.equals("entities-sentiment")) { - if (text.startsWith("gs://")) { - entitySentimentFile(text); - } else { - entitySentimentText(text); - } - } - } - - /** Identifies entities in the string {@code text}. */ - public static void analyzeEntitiesText(String text) throws Exception { - // [START language_entities_text] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - AnalyzeEntitiesRequest request = - AnalyzeEntitiesRequest.newBuilder() - .setDocument(doc) - .setEncodingType(EncodingType.UTF16) - .build(); - - AnalyzeEntitiesResponse response = language.analyzeEntities(request); - - // Print the response - for (Entity entity : response.getEntitiesList()) { - System.out.printf("Entity: %s", entity.getName()); - System.out.printf("Salience: %.3f\n", entity.getSalience()); - System.out.println("Metadata: "); - for (Map.Entry entry : entity.getMetadataMap().entrySet()) { - System.out.printf("%s : %s", entry.getKey(), entry.getValue()); - } - for (EntityMention mention : entity.getMentionsList()) { - System.out.printf("Begin offset: %d\n", mention.getText().getBeginOffset()); - System.out.printf("Content: %s\n", mention.getText().getContent()); - System.out.printf("Type: %s\n\n", mention.getType()); - } - } - } - // [END language_entities_text] - } - - /** Identifies entities in the contents of the object at the given GCS {@code path}. */ - public static void analyzeEntitiesFile(String gcsUri) throws Exception { - // [START language_entities_gcs] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - // Set the GCS Content URI path to the file to be analyzed - Document doc = - Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); - AnalyzeEntitiesRequest request = - AnalyzeEntitiesRequest.newBuilder() - .setDocument(doc) - .setEncodingType(EncodingType.UTF16) - .build(); - - AnalyzeEntitiesResponse response = language.analyzeEntities(request); - - // Print the response - for (Entity entity : response.getEntitiesList()) { - System.out.printf("Entity: %s\n", entity.getName()); - System.out.printf("Salience: %.3f\n", entity.getSalience()); - System.out.println("Metadata: "); - for (Map.Entry entry : entity.getMetadataMap().entrySet()) { - System.out.printf("%s : %s", entry.getKey(), entry.getValue()); - } - for (EntityMention mention : entity.getMentionsList()) { - System.out.printf("Begin offset: %d\n", mention.getText().getBeginOffset()); - System.out.printf("Content: %s\n", mention.getText().getContent()); - System.out.printf("Type: %s\n\n", mention.getType()); - } - } - } - // [END language_entities_gcs] - } - - /** Identifies the sentiment in the string {@code text}. */ - public static Sentiment analyzeSentimentText(String text) throws Exception { - // [START language_sentiment_text] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - AnalyzeSentimentResponse response = language.analyzeSentiment(doc); - Sentiment sentiment = response.getDocumentSentiment(); - if (sentiment == null) { - System.out.println("No sentiment found"); - } else { - System.out.printf("Sentiment magnitude: %.3f\n", sentiment.getMagnitude()); - System.out.printf("Sentiment score: %.3f\n", sentiment.getScore()); - } - return sentiment; - } - // [END language_sentiment_text] - } - - /** Gets {@link Sentiment} from the contents of the GCS hosted file. */ - public static Sentiment analyzeSentimentFile(String gcsUri) throws Exception { - // [START language_sentiment_gcs] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = - Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); - AnalyzeSentimentResponse response = language.analyzeSentiment(doc); - Sentiment sentiment = response.getDocumentSentiment(); - if (sentiment == null) { - System.out.println("No sentiment found"); - } else { - System.out.printf("Sentiment magnitude : %.3f\n", sentiment.getMagnitude()); - System.out.printf("Sentiment score : %.3f\n", sentiment.getScore()); - } - return sentiment; - } - // [END language_sentiment_gcs] - } - - /** from the string {@code text}. */ - public static List analyzeSyntaxText(String text) throws Exception { - // [START language_syntax_text] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - AnalyzeSyntaxRequest request = - AnalyzeSyntaxRequest.newBuilder() - .setDocument(doc) - .setEncodingType(EncodingType.UTF16) - .build(); - // Analyze the syntax in the given text - AnalyzeSyntaxResponse response = language.analyzeSyntax(request); - // Print the response - for (Token token : response.getTokensList()) { - System.out.printf("\tText: %s\n", token.getText().getContent()); - System.out.printf("\tBeginOffset: %d\n", token.getText().getBeginOffset()); - System.out.printf("Lemma: %s\n", token.getLemma()); - System.out.printf("PartOfSpeechTag: %s\n", token.getPartOfSpeech().getTag()); - System.out.printf("\tAspect: %s\n", token.getPartOfSpeech().getAspect()); - System.out.printf("\tCase: %s\n", token.getPartOfSpeech().getCase()); - System.out.printf("\tForm: %s\n", token.getPartOfSpeech().getForm()); - System.out.printf("\tGender: %s\n", token.getPartOfSpeech().getGender()); - System.out.printf("\tMood: %s\n", token.getPartOfSpeech().getMood()); - System.out.printf("\tNumber: %s\n", token.getPartOfSpeech().getNumber()); - System.out.printf("\tPerson: %s\n", token.getPartOfSpeech().getPerson()); - System.out.printf("\tProper: %s\n", token.getPartOfSpeech().getProper()); - System.out.printf("\tReciprocity: %s\n", token.getPartOfSpeech().getReciprocity()); - System.out.printf("\tTense: %s\n", token.getPartOfSpeech().getTense()); - System.out.printf("\tVoice: %s\n", token.getPartOfSpeech().getVoice()); - System.out.println("DependencyEdge"); - System.out.printf("\tHeadTokenIndex: %d\n", token.getDependencyEdge().getHeadTokenIndex()); - System.out.printf("\tLabel: %s\n\n", token.getDependencyEdge().getLabel()); - } - return response.getTokensList(); - } - // [END language_syntax_text] - } - - /** Get the syntax of the GCS hosted file. */ - public static List analyzeSyntaxFile(String gcsUri) throws Exception { - // [START language_syntax_gcs] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = - Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); - AnalyzeSyntaxRequest request = - AnalyzeSyntaxRequest.newBuilder() - .setDocument(doc) - .setEncodingType(EncodingType.UTF16) - .build(); - // Analyze the syntax in the given text - AnalyzeSyntaxResponse response = language.analyzeSyntax(request); - // Print the response - for (Token token : response.getTokensList()) { - System.out.printf("\tText: %s\n", token.getText().getContent()); - System.out.printf("\tBeginOffset: %d\n", token.getText().getBeginOffset()); - System.out.printf("Lemma: %s\n", token.getLemma()); - System.out.printf("PartOfSpeechTag: %s\n", token.getPartOfSpeech().getTag()); - System.out.printf("\tAspect: %s\n", token.getPartOfSpeech().getAspect()); - System.out.printf("\tCase: %s\n", token.getPartOfSpeech().getCase()); - System.out.printf("\tForm: %s\n", token.getPartOfSpeech().getForm()); - System.out.printf("\tGender: %s\n", token.getPartOfSpeech().getGender()); - System.out.printf("\tMood: %s\n", token.getPartOfSpeech().getMood()); - System.out.printf("\tNumber: %s\n", token.getPartOfSpeech().getNumber()); - System.out.printf("\tPerson: %s\n", token.getPartOfSpeech().getPerson()); - System.out.printf("\tProper: %s\n", token.getPartOfSpeech().getProper()); - System.out.printf("\tReciprocity: %s\n", token.getPartOfSpeech().getReciprocity()); - System.out.printf("\tTense: %s\n", token.getPartOfSpeech().getTense()); - System.out.printf("\tVoice: %s\n", token.getPartOfSpeech().getVoice()); - System.out.println("DependencyEdge"); - System.out.printf("\tHeadTokenIndex: %d\n", token.getDependencyEdge().getHeadTokenIndex()); - System.out.printf("\tLabel: %s\n\n", token.getDependencyEdge().getLabel()); - } - - return response.getTokensList(); - } - // [END language_syntax_gcs] - } - - /** Detects categories in text using the Language Beta API. */ - public static void classifyText(String text) throws Exception { - // [START language_classify_text] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - // Set content to the text string - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - V2Model v2Model = - V2Model.newBuilder().setContentCategoriesVersion(ContentCategoriesVersion.V2).build(); - ClassificationModelOptions options = - ClassificationModelOptions.newBuilder().setV2Model(v2Model).build(); - ClassifyTextRequest request = - ClassifyTextRequest.newBuilder() - .setDocument(doc) - .setClassificationModelOptions(options) - .build(); - // Detect categories in the given text - ClassifyTextResponse response = language.classifyText(request); - - for (ClassificationCategory category : response.getCategoriesList()) { - System.out.printf( - "Category name : %s, Confidence : %.3f\n", - category.getName(), category.getConfidence()); - } - } - // [END language_classify_text] - } - - /** Detects categories in a GCS hosted file using the Language Beta API. */ - public static void classifyFile(String gcsUri) throws Exception { - // [START language_classify_gcs] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - // Set the GCS content URI path - Document doc = - Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); - ClassifyTextRequest request = ClassifyTextRequest.newBuilder().setDocument(doc).build(); - // Detect categories in the given file - ClassifyTextResponse response = language.classifyText(request); - - for (ClassificationCategory category : response.getCategoriesList()) { - System.out.printf( - "Category name : %s, Confidence : %.3f\n", - category.getName(), category.getConfidence()); - } - } - // [END language_classify_gcs] - } - - /** Detects the entity sentiments in the string {@code text} using the Language Beta API. */ - public static void entitySentimentText(String text) throws Exception { - // [START language_entity_sentiment_text] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - AnalyzeEntitySentimentRequest request = - AnalyzeEntitySentimentRequest.newBuilder() - .setDocument(doc) - .setEncodingType(EncodingType.UTF16) - .build(); - // Detect entity sentiments in the given string - AnalyzeEntitySentimentResponse response = language.analyzeEntitySentiment(request); - // Print the response - for (Entity entity : response.getEntitiesList()) { - System.out.printf("Entity: %s\n", entity.getName()); - System.out.printf("Salience: %.3f\n", entity.getSalience()); - System.out.printf("Sentiment : %s\n", entity.getSentiment()); - for (EntityMention mention : entity.getMentionsList()) { - System.out.printf("Begin offset: %d\n", mention.getText().getBeginOffset()); - System.out.printf("Content: %s\n", mention.getText().getContent()); - System.out.printf("Magnitude: %.3f\n", mention.getSentiment().getMagnitude()); - System.out.printf("Sentiment score : %.3f\n", mention.getSentiment().getScore()); - System.out.printf("Type: %s\n\n", mention.getType()); - } - } - } - // [END language_entity_sentiment_text] - } - - /** Identifies the entity sentiments in the GCS hosted file using the Language Beta API. */ - public static void entitySentimentFile(String gcsUri) throws Exception { - // [START language_entity_sentiment_gcs] - // Instantiate the Language client com.google.cloud.language.v1.LanguageServiceClient - try (LanguageServiceClient language = LanguageServiceClient.create()) { - Document doc = - Document.newBuilder().setGcsContentUri(gcsUri).setType(Type.PLAIN_TEXT).build(); - AnalyzeEntitySentimentRequest request = - AnalyzeEntitySentimentRequest.newBuilder() - .setDocument(doc) - .setEncodingType(EncodingType.UTF16) - .build(); - // Detect entity sentiments in the given file - AnalyzeEntitySentimentResponse response = language.analyzeEntitySentiment(request); - // Print the response - for (Entity entity : response.getEntitiesList()) { - System.out.printf("Entity: %s\n", entity.getName()); - System.out.printf("Salience: %.3f\n", entity.getSalience()); - System.out.printf("Sentiment : %s\n", entity.getSentiment()); - for (EntityMention mention : entity.getMentionsList()) { - System.out.printf("Begin offset: %d\n", mention.getText().getBeginOffset()); - System.out.printf("Content: %s\n", mention.getText().getContent()); - System.out.printf("Magnitude: %.3f\n", mention.getSentiment().getMagnitude()); - System.out.printf("Sentiment score : %.3f\n", mention.getSentiment().getScore()); - System.out.printf("Type: %s\n\n", mention.getType()); - } - } - } - // [END language_entity_sentiment_gcs] - } -} diff --git a/samples/snippets/src/main/java/com/example/language/QuickstartSample.java b/samples/snippets/src/main/java/com/example/language/QuickstartSample.java deleted file mode 100644 index c264dc96..00000000 --- a/samples/snippets/src/main/java/com/example/language/QuickstartSample.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.language; - -// [START language_quickstart] -// Imports the Google Cloud client library -import com.google.cloud.language.v1.Document; -import com.google.cloud.language.v1.Document.Type; -import com.google.cloud.language.v1.LanguageServiceClient; -import com.google.cloud.language.v1.Sentiment; - -public class QuickstartSample { - public static void main(String... args) throws Exception { - // Instantiates a client - try (LanguageServiceClient language = LanguageServiceClient.create()) { - - // The text to analyze - String text = "Hello, world!"; - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - - // Detects the sentiment of the text - Sentiment sentiment = language.analyzeSentiment(doc).getDocumentSentiment(); - - System.out.printf("Text: %s%n", text); - System.out.printf("Sentiment: %s, %s%n", sentiment.getScore(), sentiment.getMagnitude()); - } - } -} -// [END language_quickstart] diff --git a/samples/snippets/src/main/java/com/example/language/SetEndpoint.java b/samples/snippets/src/main/java/com/example/language/SetEndpoint.java deleted file mode 100644 index 73ab525a..00000000 --- a/samples/snippets/src/main/java/com/example/language/SetEndpoint.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.language; - -import com.google.cloud.language.v1.Document; -import com.google.cloud.language.v1.LanguageServiceClient; -import com.google.cloud.language.v1.LanguageServiceSettings; -import com.google.cloud.language.v1.Sentiment; -import java.io.IOException; - -class SetEndpoint { - - // Change your endpoint - static void setEndpoint() throws IOException { - // [START language_set_endpoint] - LanguageServiceSettings settings = - LanguageServiceSettings.newBuilder().setEndpoint("eu-language.googleapis.com:443").build(); - - // Initialize client that will be used to send requests. This client only needs to be created - // once, and can be reused for multiple requests. After completing all of your requests, call - // the "close" method on the client to safely clean up any remaining background resources. - LanguageServiceClient client = LanguageServiceClient.create(settings); - // [END language_set_endpoint] - - // The text to analyze - String text = "Hello, world!"; - Document doc = Document.newBuilder().setContent(text).setType(Document.Type.PLAIN_TEXT).build(); - - // Detects the sentiment of the text - Sentiment sentiment = client.analyzeSentiment(doc).getDocumentSentiment(); - - System.out.printf("Text: %s%n", text); - System.out.printf("Sentiment: %s, %s%n", sentiment.getScore(), sentiment.getMagnitude()); - client.close(); - } -} diff --git a/samples/snippets/src/test/java/beta/example/language/AnalyzeBetaIT.java b/samples/snippets/src/test/java/beta/example/language/AnalyzeBetaIT.java index 5c4f1101..8922425b 100644 --- a/samples/snippets/src/test/java/beta/example/language/AnalyzeBetaIT.java +++ b/samples/snippets/src/test/java/beta/example/language/AnalyzeBetaIT.java @@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat; -import com.example.language.Analyze; import com.google.cloud.language.v1beta2.Sentiment; import java.io.ByteArrayOutputStream; import java.io.PrintStream; @@ -28,7 +27,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** Integration (system) tests for {@link Analyze}. */ +/** Integration (system) tests for {@link AnalyzeBeta}. */ @RunWith(JUnit4.class) @SuppressWarnings("checkstyle:abbreviationaswordinname") public class AnalyzeBetaIT { diff --git a/samples/snippets/src/test/java/com/example/language/AnalyzeIT.java b/samples/snippets/src/test/java/com/example/language/AnalyzeIT.java deleted file mode 100644 index f80ee83c..00000000 --- a/samples/snippets/src/test/java/com/example/language/AnalyzeIT.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.language; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.cloud.language.v1.PartOfSpeech.Tag; -import com.google.cloud.language.v1.Sentiment; -import com.google.cloud.language.v1.Token; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.util.List; -import java.util.stream.Collectors; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Integration (system) tests for {@link Analyze}. */ -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class AnalyzeIT { - - private ByteArrayOutputStream bout; - private PrintStream out; - private PrintStream originalPrintStream; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - originalPrintStream = System.out; - System.setOut(out); - } - - @After - public void tearDown() { - // restores print statements in the original method - System.out.flush(); - System.setOut(originalPrintStream); - } - - @Test - public void analyzeCategoriesInTextReturnsExpectedResult() throws Exception { - Analyze.classifyText( - "Android is a mobile operating system developed by Google, " - + "based on the Linux kernel and designed primarily for touchscreen " - + "mobile devices such as smartphones and tablets."); - String got = bout.toString(); - assertThat(got).contains("Computers & Electronics"); - } - - @Test - public void analyzeCategoriesInFileReturnsExpectedResult() throws Exception { - String gcsFile = "gs://cloud-samples-data/language/android.txt"; - Analyze.classifyFile(gcsFile); - String got = bout.toString(); - assertThat(got).contains("Computers & Electronics"); - } - - @Test - public void analyzeEntities_withEntities_returnsLarryPage() throws Exception { - Analyze.analyzeEntitiesText( - "Larry Page, Google's co-founder, once described the 'perfect search engine' as" - + " something that 'understands exactly what you mean and gives you back exactly what" - + " you want.' Since he spoke those words Google has grown to offer products beyond" - + " search, but the spirit of what he said remains."); - String got = bout.toString(); - assertThat(got).contains("Larry Page"); - } - - @Test - public void analyzeEntities_withEntitiesFile_containsCalifornia() throws Exception { - Analyze.analyzeEntitiesFile("gs://cloud-samples-data/language/entity.txt"); - String got = bout.toString(); - assertThat(got).contains("California"); - } - - @Test - public void analyzeSentimentText_returnPositive() throws Exception { - Sentiment sentiment = - Analyze.analyzeSentimentText( - "Tom Cruise is one of the finest actors in hollywood and a great star!"); - assertThat(sentiment.getMagnitude()).isGreaterThan(0.0F); - assertThat(sentiment.getScore()).isGreaterThan(0.0F); - } - - @Test - public void analyzeSentimentFile_returnPositiveFile() throws Exception { - Sentiment sentiment = - Analyze.analyzeSentimentFile( - "gs://cloud-samples-data/language/" + "sentiment-positive.txt"); - assertThat(sentiment.getMagnitude()).isGreaterThan(0.0F); - assertThat(sentiment.getScore()).isGreaterThan(0.0F); - } - - @Test - public void analyzeSentimentText_returnNegative() throws Exception { - Sentiment sentiment = - Analyze.analyzeSentimentText("That was the worst performance I've seen in a while."); - assertThat(sentiment.getMagnitude()).isGreaterThan(0.0F); - assertThat(sentiment.getScore()).isLessThan(0.0F); - } - - @Test - public void analyzeSentiment_returnNegative() throws Exception { - Sentiment sentiment = - Analyze.analyzeSentimentFile( - "gs://cloud-samples-data/language/" + "sentiment-negative.txt"); - assertThat(sentiment.getMagnitude()).isGreaterThan(0.0F); - assertThat(sentiment.getScore()).isLessThan(0.0F); - } - - @Test - public void analyzeSyntax_partOfSpeech() throws Exception { - List tokens = - Analyze.analyzeSyntaxText("President Obama was elected for the second term"); - - List got = - tokens.stream().map(e -> e.getPartOfSpeech().getTag()).collect(Collectors.toList()); - - assertThat(got) - .containsExactly( - Tag.NOUN, Tag.NOUN, Tag.VERB, Tag.VERB, Tag.ADP, Tag.DET, Tag.ADJ, Tag.NOUN) - .inOrder(); - } - - @Test - public void analyzeSyntax_partOfSpeechFile() throws Exception { - List token = - Analyze.analyzeSyntaxFile("gs://cloud-samples-data/language/" + "syntax-sentence.txt"); - - List got = - token.stream().map(e -> e.getPartOfSpeech().getTag()).collect(Collectors.toList()); - assertThat(got) - .containsExactly(Tag.DET, Tag.VERB, Tag.DET, Tag.ADJ, Tag.NOUN, Tag.PUNCT) - .inOrder(); - } - - @Test - public void analyzeEntitySentimentTextReturnsExpectedResult() throws Exception { - Analyze.entitySentimentText( - "Oranges, grapes, and apples can be " - + "found in the cafeterias located in Mountain View, Seattle, and London."); - String got = bout.toString(); - assertThat(got).contains("Seattle"); - } - - @Test - public void analyzeEntitySentimentTextEncodedReturnsExpectedResult() throws Exception { - Analyze.entitySentimentText("fooβ†’bar"); - String got = bout.toString(); - assertThat(got).contains("offset: 4"); - } - - @Test - public void analyzeEntitySentimenFileReturnsExpectedResult() throws Exception { - Analyze.entitySentimentFile("gs://cloud-samples-data/language/president.txt"); - String got = bout.toString(); - assertThat(got).contains("Kennedy"); - } -} diff --git a/samples/snippets/src/test/java/com/example/language/QuickstartSampleIT.java b/samples/snippets/src/test/java/com/example/language/QuickstartSampleIT.java deleted file mode 100644 index 15a89ff5..00000000 --- a/samples/snippets/src/test/java/com/example/language/QuickstartSampleIT.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.language; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests for quickstart sample. */ -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class QuickstartSampleIT { - private ByteArrayOutputStream bout; - private PrintStream out; - private PrintStream originalPrintStream; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - originalPrintStream = System.out; - System.setOut(out); - } - - @After - public void tearDown() { - // restores print statements in the original method - System.out.flush(); - System.setOut(originalPrintStream); - } - - @Test - public void testQuickstart() throws Exception { - // Act - QuickstartSample.main(); - - // Assert - String got = bout.toString(); - assertThat(got).contains("Text: Hello, world!"); - assertThat(got).contains("Sentiment: "); - } -} diff --git a/samples/snippets/src/test/java/com/example/language/SetEndpointIT.java b/samples/snippets/src/test/java/com/example/language/SetEndpointIT.java deleted file mode 100644 index f464f472..00000000 --- a/samples/snippets/src/test/java/com/example/language/SetEndpointIT.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.language; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests for Natural Language Set Endpoint */ -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class SetEndpointIT { - - private ByteArrayOutputStream bout; - private PrintStream out; - private PrintStream originalPrintStream; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - originalPrintStream = System.out; - System.setOut(out); - } - - @After - public void tearDown() { - // restores print statements in the original method - System.out.flush(); - System.setOut(originalPrintStream); - } - - @Test - public void testSetEndpoint() throws IOException { - // Act - SetEndpoint.setEndpoint(); - - // Assert - String got = bout.toString(); - assertThat(got).contains("Sentiment"); - } -} From 8651836b7ed5a3f3923a39d41311fcd091241662 Mon Sep 17 00:00:00 2001 From: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com> Date: Thu, 23 Mar 2023 13:55:32 -0400 Subject: [PATCH 38/43] chore: Disabling owlbot (#970) --- .github/.OwlBot.lock.yaml | 16 ---------------- .github/.OwlBot.yaml | 32 -------------------------------- owlbot.py | 24 ------------------------ 3 files changed, 72 deletions(-) delete mode 100644 .github/.OwlBot.lock.yaml delete mode 100644 .github/.OwlBot.yaml delete mode 100644 owlbot.py diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml deleted file mode 100644 index 77cf6087..00000000 --- a/.github/.OwlBot.lock.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:edae91ccdd2dded2f572ec341a768ad180305a3e8fbfd93064b28e237d35920a diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml deleted file mode 100644 index ac6c20ab..00000000 --- a/.github/.OwlBot.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -docker: - image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" - -deep-remove-regex: -- "/samples/snippets/generated" -- "/grpc-google-.*/src" -- "/proto-google-.*/src" -- "/google-.*/src" - -deep-copy-regex: -- source: "/google/cloud/language/(v.*)/.*-java/proto-google-.*/src" - dest: "/owl-bot-staging/$1/proto-google-cloud-language-$1/src" -- source: "/google/cloud/language/(v.*)/.*-java/grpc-google-.*/src" - dest: "/owl-bot-staging/$1/grpc-google-cloud-language-$1/src" -- source: "/google/cloud/language/(v.*)/.*-java/gapic-google-.*/src" - dest: "/owl-bot-staging/$1/google-cloud-language/src" -- source: "/google/cloud/language/(v.*)/.*-java/samples/snippets/generated" - dest: "/owl-bot-staging/$1/samples/snippets/generated" diff --git a/owlbot.py b/owlbot.py deleted file mode 100644 index dca9d867..00000000 --- a/owlbot.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2021 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. - -import synthtool as s -from synthtool.languages import java - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.move(library) - -s.remove_staging_dirs() -java.common_templates() From 30f4a6cf165e667ab437710b7899f47f37aa5832 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 11:02:35 -0400 Subject: [PATCH 39/43] chore: Adding release-please annotations and latest Libraries BOM to readme files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Adding release-please annotations to readme files (#1781) * chore: Adding release-please annotations to readme files Source-Link: https://github.com/googleapis/synthtool/commit/327d46fbfc2c02ff9237c3107513bfa682a94da0 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:bf5639d265d70f6137d57d42ae781a6f4e26d4085ff4e018e71350480f9b3996 * Libraries BOM 26.11.0 https://central.sonatype.com/artifact/com.google.cloud/libraries-bom/26.11.0 * πŸ¦‰ Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Disabling owlbot (#970) * consistent 26.11.0 --------- Co-authored-by: Owl Bot Co-authored-by: Tomo Suzuki Co-authored-by: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com> --- .github/dependabot.yml | 14 ++ .kokoro/build.sh | 4 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- .kokoro/requirements.in | 39 +--- .kokoro/requirements.txt | 247 ++++++++++-------------- README.md | 15 +- 7 files changed, 129 insertions(+), 194 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..c8f413b0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for Maven dependencies + open-pull-requests-limit: 0 + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for pip dependencies + open-pull-requests-limit: 0 \ No newline at end of file diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 1eeed9f9..9f2fbca4 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -71,12 +71,12 @@ integration) ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; graalvm17) # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; samples) diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index a3f7fb9d..e20330c3 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 4c7225ec..0fd6ba2f 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" } env_vars: { diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 6aa7cf2b..2092cc74 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,33 +1,6 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.8.7 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.9.24 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.11.0 -idna==3.4 \ No newline at end of file +gcp-docuploader +gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x +wheel +setuptools +typing-extensions +click<8.1.0 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 02ae42bb..c80f0a87 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,27 +1,21 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # # pip-compile --allow-unsafe --generate-hashes requirements.in # attrs==22.1.0 \ --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool cachetools==4.2.4 \ --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 - # via - # -r requirements.in - # requests + # via google-auth +certifi==2022.12.7 \ + --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ + --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 + # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ @@ -87,9 +81,7 @@ cffi==1.15.1 \ --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography + # via cryptography charset-normalizer==2.0.12 \ --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df @@ -98,62 +90,56 @@ click==8.0.4 \ --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb # via + # -r requirements.in # gcp-docuploader # gcp-releasetool colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==38.0.1 \ - --hash=sha256:0297ffc478bdd237f5ca3a7dc96fc0d315670bfa099c04dc3a4a2172008a405a \ - --hash=sha256:10d1f29d6292fc95acb597bacefd5b9e812099d75a6469004fd38ba5471a977f \ - --hash=sha256:16fa61e7481f4b77ef53991075de29fc5bacb582a1244046d2e8b4bb72ef66d0 \ - --hash=sha256:194044c6b89a2f9f169df475cc167f6157eb9151cc69af8a2a163481d45cc407 \ - --hash=sha256:1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7 \ - --hash=sha256:3261725c0ef84e7592597606f6583385fed2a5ec3909f43bc475ade9729a41d6 \ - --hash=sha256:3b72c360427889b40f36dc214630e688c2fe03e16c162ef0aa41da7ab1455153 \ - --hash=sha256:3e3a2599e640927089f932295a9a247fc40a5bdf69b0484532f530471a382750 \ - --hash=sha256:3fc26e22840b77326a764ceb5f02ca2d342305fba08f002a8c1f139540cdfaad \ - --hash=sha256:5067ee7f2bce36b11d0e334abcd1ccf8c541fc0bbdaf57cdd511fdee53e879b6 \ - --hash=sha256:52e7bee800ec869b4031093875279f1ff2ed12c1e2f74923e8f49c916afd1d3b \ - --hash=sha256:64760ba5331e3f1794d0bcaabc0d0c39e8c60bf67d09c93dc0e54189dfd7cfe5 \ - --hash=sha256:765fa194a0f3372d83005ab83ab35d7c5526c4e22951e46059b8ac678b44fa5a \ - --hash=sha256:79473cf8a5cbc471979bd9378c9f425384980fcf2ab6534b18ed7d0d9843987d \ - --hash=sha256:896dd3a66959d3a5ddcfc140a53391f69ff1e8f25d93f0e2e7830c6de90ceb9d \ - --hash=sha256:89ed49784ba88c221756ff4d4755dbc03b3c8d2c5103f6d6b4f83a0fb1e85294 \ - --hash=sha256:ac7e48f7e7261207d750fa7e55eac2d45f720027d5703cd9007e9b37bbb59ac0 \ - --hash=sha256:ad7353f6ddf285aeadfaf79e5a6829110106ff8189391704c1d8801aa0bae45a \ - --hash=sha256:b0163a849b6f315bf52815e238bc2b2346604413fa7c1601eea84bcddb5fb9ac \ - --hash=sha256:b6c9b706316d7b5a137c35e14f4103e2115b088c412140fdbd5f87c73284df61 \ - --hash=sha256:c2e5856248a416767322c8668ef1845ad46ee62629266f84a8f007a317141013 \ - --hash=sha256:ca9f6784ea96b55ff41708b92c3f6aeaebde4c560308e5fbbd3173fbc466e94e \ - --hash=sha256:d1a5bd52d684e49a36582193e0b89ff267704cd4025abefb9e26803adeb3e5fb \ - --hash=sha256:d3971e2749a723e9084dd507584e2a2761f78ad2c638aa31e80bc7a15c9db4f9 \ - --hash=sha256:d4ef6cc305394ed669d4d9eebf10d3a101059bdcf2669c366ec1d14e4fb227bd \ - --hash=sha256:d9e69ae01f99abe6ad646947bba8941e896cb3aa805be2597a0400e0764b5818 +cryptography==39.0.1 \ + --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ + --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ + --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ + --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ + --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ + --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ + --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ + --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ + --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ + --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ + --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ + --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ + --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ + --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ + --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ + --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ + --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ + --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ + --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ + --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ + --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 # via # gcp-releasetool # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b +gcp-docuploader==0.6.4 \ + --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ + --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.8.7 \ - --hash=sha256:3d2a67c9db39322194afb3b427e9cb0476ce8f2a04033695f0aeb63979fc2b37 \ - --hash=sha256:5e4d28f66e90780d77f3ecf1e9155852b0c3b13cbccb08ab07e66b2357c8da8d +gcp-releasetool==1.10.5 \ + --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ + --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 # via -r requirements.in google-api-core==2.8.2 \ --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 # via - # -r requirements.in # google-cloud-core # google-cloud-storage -google-auth==2.11.0 \ - --hash=sha256:be62acaae38d0049c21ca90f27a23847245c9f161ff54ede13af2cb6afecbac9 \ - --hash=sha256:ed65ecf9f681832298e29328e1ef0a3676e3732b2e56f41532d45f70a22de0fb +google-auth==2.14.1 \ + --hash=sha256:ccaa901f31ad5cbb562615eb8b664b3dd0bf5404a67618e642307f00613eda4d \ + --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 # via - # -r requirements.in # gcp-releasetool # google-api-core # google-cloud-core @@ -161,15 +147,11 @@ google-auth==2.11.0 \ google-cloud-core==2.3.1 \ --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage + # via google-cloud-storage google-cloud-storage==2.0.0 \ --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader + # via gcp-docuploader google-crc32c==1.3.0 \ --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ @@ -214,52 +196,37 @@ google-crc32c==1.3.0 \ --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media + # via google-resumable-media google-resumable-media==2.3.3 \ --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage + # via google-cloud-storage googleapis-common-protos==1.56.3 \ --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core + # via google-api-core idna==3.4 \ --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests + # via requests importlib-metadata==4.8.3 \ --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 + # via keyring +jeepney==0.8.0 \ + --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ + --hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755 # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in # keyring # secretstorage jinja2==3.0.3 \ --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool keyring==23.4.1 \ --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool markupsafe==2.0.1 \ --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ @@ -330,49 +297,39 @@ markupsafe==2.0.1 \ --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 + # via jinja2 packaging==21.3 \ --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 + # via gcp-releasetool +protobuf==3.20.2 \ + --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ + --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ + --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ + --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ + --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ + --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ + --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ + --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ + --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ + --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ + --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ + --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ + --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ + --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ + --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ + --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ + --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ + --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ + --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ + --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ + --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ + --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in # gcp-docuploader # gcp-releasetool # google-api-core # google-cloud-storage - # googleapis-common-protos pyasn1==0.4.8 \ --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba @@ -386,71 +343,61 @@ pyasn1-modules==0.2.8 \ pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi + # via cffi pyjwt==2.4.0 \ --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool pyparsing==3.0.9 \ --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging + # via packaging pyperclip==1.8.2 \ --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool requests==2.27.1 \ --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d # via - # -r requirements.in # gcp-releasetool # google-api-core # google-cloud-storage rsa==4.9 \ --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth + # via google-auth secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring +setuptools==67.3.2 \ + --hash=sha256:95f00380ef2ffa41d9bba85d95b27689d923c93dfbafed4aecd7cf988a25e012 \ + --hash=sha256:bb6d8e508de562768f2027902929f8523932fcd1fb784e6d573d2cafac995a48 + # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 # via - # -r requirements.in # gcp-docuploader # google-auth # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 +typing-extensions==4.4.0 \ + --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ + --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e # via -r requirements.in urllib3==1.26.12 \ --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests + # via requests +wheel==0.38.4 \ + --hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \ + --hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8 + # via -r requirements.in zipp==3.6.0 \ --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata + # via importlib-metadata diff --git a/README.md b/README.md index 7c374324..9cecfa6b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.1.4 + 26.11.0 pom import @@ -56,21 +56,22 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.4') +implementation platform('com.google.cloud:libraries-bom:26.11.0') implementation 'com.google.cloud:google-cloud-language' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.7.0' +implementation 'com.google.cloud:google-cloud-language:2.14.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.7.0" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.14.0" ``` + ## Authentication @@ -87,7 +88,7 @@ The client application making API calls must be granted [authorization scopes][a You will need a [Google Cloud Platform Console][developer-console] project with the Natural Language [API enabled][enable-api]. You will need to [enable billing][enable-billing] to use Google Natural Language. [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: +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. ### Installation and setup @@ -249,14 +250,14 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-language/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-language.svg -[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-language&core=gav +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-language/2.14.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles [iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects -[cloud-sdk]: https://cloud.google.com/sdk/ +[cloud-cli]: https://cloud.google.com/cli [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting [contributing]: https://github.com/googleapis/java-language/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/java-language/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct From a4e3b65123257ec52c3b4e7542a382d0df501963 Mon Sep 17 00:00:00 2001 From: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com> Date: Wed, 3 May 2023 17:38:33 +0000 Subject: [PATCH 40/43] chore: Disabling release-please (#972) --- .github/release-please.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .github/release-please.yml diff --git a/.github/release-please.yml b/.github/release-please.yml deleted file mode 100644 index 7bf58076..00000000 --- a/.github/release-please.yml +++ /dev/null @@ -1,8 +0,0 @@ -bumpMinorPreMajor: true -handleGHRelease: true -releaseType: java-yoshi -branches: - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: java7 From f1471363de37d929ce442167d09ae148c140b8ab Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 31 May 2023 12:25:50 -0700 Subject: [PATCH 41/43] build: enable multiScm for releases (#973) --- .github/release-trigger.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml index d4ca9418..46c556a2 100644 --- a/.github/release-trigger.yml +++ b/.github/release-trigger.yml @@ -1 +1,2 @@ enabled: true +multiScmName: java-language From 45995b79d8b5efda05666e18915a2c5c3fabb0c3 Mon Sep 17 00:00:00 2001 From: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com> Date: Wed, 5 Jul 2023 14:09:10 +0000 Subject: [PATCH 42/43] chore: Bringing back release-please.yml (#976) --- .github/release-please.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/release-please.yml diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..7bf58076 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,8 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi +branches: + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + branch: java7 From de1bf94b847a750e301643168b97a62d7ca80a50 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 6 Jul 2023 10:42:33 -0400 Subject: [PATCH 43/43] chore: removing outdated files in favor of https://github.com/googleapis/google-cloud-java/tree/main/java-language (#977) --- .github/CODEOWNERS | 13 - .github/ISSUE_TEMPLATE/bug_report.md | 56 - .github/ISSUE_TEMPLATE/feature_request.md | 26 - .github/ISSUE_TEMPLATE/support_request.md | 7 - .github/PULL_REQUEST_TEMPLATE.md | 10 - .github/auto-label.yaml | 15 - .github/blunderbuss.yml | 7 - .github/dependabot.yml | 14 - .github/generated-files-bot.yml | 12 - .github/snippet-bot.yml | 0 .github/sync-repo-settings.yaml | 42 - .github/trusted-contribution.yml | 3 - .github/workflows/approve-readme.yaml | 69 - .github/workflows/auto-release.yaml | 103 - .github/workflows/ci.yaml | 89 - .github/workflows/samples.yaml | 30 - .gitignore | 47 - .kokoro/build.bat | 18 - .kokoro/build.sh | 134 - .kokoro/coerce_logs.sh | 37 - .kokoro/common.cfg | 13 - .kokoro/common.sh | 60 - .kokoro/continuous/common.cfg | 25 - .kokoro/continuous/java8.cfg | 12 - .kokoro/continuous/propose_release.sh | 29 - .kokoro/dependencies.sh | 59 - .kokoro/nightly/common.cfg | 25 - .kokoro/nightly/integration.cfg | 37 - .kokoro/nightly/java11-integration.cfg | 37 - .kokoro/nightly/java11.cfg | 7 - .kokoro/nightly/java7.cfg | 7 - .kokoro/nightly/java8-osx.cfg | 3 - .kokoro/nightly/java8-win.cfg | 3 - .kokoro/nightly/java8.cfg | 12 - .kokoro/nightly/samples.cfg | 38 - .kokoro/populate-secrets.sh | 43 - .kokoro/presubmit/clirr.cfg | 13 - .kokoro/presubmit/common.cfg | 34 - .kokoro/presubmit/dependencies.cfg | 12 - .kokoro/presubmit/graalvm-native-17.cfg | 33 - .kokoro/presubmit/graalvm-native.cfg | 33 - .kokoro/presubmit/integration.cfg | 33 - .kokoro/presubmit/java11.cfg | 7 - .kokoro/presubmit/java7.cfg | 7 - .kokoro/presubmit/java8-osx.cfg | 3 - .kokoro/presubmit/java8-win.cfg | 3 - .kokoro/presubmit/java8.cfg | 12 - .kokoro/presubmit/linkage-monitor.cfg | 12 - .kokoro/presubmit/lint.cfg | 13 - .kokoro/presubmit/samples.cfg | 33 - .kokoro/readme.sh | 45 - .kokoro/release/bump_snapshot.cfg | 53 - .kokoro/release/bump_snapshot.sh | 30 - .kokoro/release/common.cfg | 49 - .kokoro/release/common.sh | 50 - .kokoro/release/drop.cfg | 6 - .kokoro/release/drop.sh | 32 - .kokoro/release/promote.cfg | 6 - .kokoro/release/promote.sh | 34 - .kokoro/release/publish_javadoc.cfg | 23 - .kokoro/release/publish_javadoc.sh | 53 - .kokoro/release/publish_javadoc11.cfg | 30 - .kokoro/release/publish_javadoc11.sh | 63 - .kokoro/release/snapshot.cfg | 6 - .kokoro/release/snapshot.sh | 33 - .kokoro/release/stage.cfg | 19 - .kokoro/release/stage.sh | 47 - .kokoro/requirements.in | 6 - .kokoro/requirements.txt | 403 -- .kokoro/trampoline.sh | 26 - .readme-partials.yaml | 33 - .repo-metadata.json | 17 - CHANGELOG.md | 498 -- codecov.yaml | 4 - google-cloud-language-bom/pom.xml | 91 - google-cloud-language/pom.xml | 135 - .../language/v1/LanguageServiceClient.java | 910 --- .../language/v1/LanguageServiceSettings.java | 261 - .../cloud/language/v1/gapic_metadata.json | 36 - .../cloud/language/v1/package-info.java | 44 - .../GrpcLanguageServiceCallableFactory.java | 113 - .../v1/stub/GrpcLanguageServiceStub.java | 297 - ...ttpJsonLanguageServiceCallableFactory.java | 105 - .../v1/stub/HttpJsonLanguageServiceStub.java | 467 -- .../language/v1/stub/LanguageServiceStub.java | 72 - .../v1/stub/LanguageServiceStubSettings.java | 469 -- .../v1beta2/LanguageServiceClient.java | 913 --- .../v1beta2/LanguageServiceSettings.java | 262 - .../language/v1beta2/gapic_metadata.json | 36 - .../cloud/language/v1beta2/package-info.java | 44 - .../GrpcLanguageServiceCallableFactory.java | 115 - .../v1beta2/stub/GrpcLanguageServiceStub.java | 300 - ...ttpJsonLanguageServiceCallableFactory.java | 105 - .../stub/HttpJsonLanguageServiceStub.java | 468 -- .../v1beta2/stub/LanguageServiceStub.java | 74 - .../stub/LanguageServiceStubSettings.java | 470 -- .../v1/LanguageServiceClientHttpJsonTest.java | 595 -- .../v1/LanguageServiceClientTest.java | 542 -- .../language/v1/MockLanguageService.java | 59 - .../language/v1/MockLanguageServiceImpl.java | 187 - .../LanguageServiceClientHttpJsonTest.java | 595 -- .../v1beta2/LanguageServiceClientTest.java | 542 -- .../language/v1beta2/MockLanguageService.java | 59 - .../v1beta2/MockLanguageServiceImpl.java | 187 - grpc-google-cloud-language-v1/pom.xml | 65 - .../language/v1/LanguageServiceGrpc.java | 1001 ---- grpc-google-cloud-language-v1beta2/pom.xml | 65 - .../language/v1beta2/LanguageServiceGrpc.java | 1006 ---- java.header | 15 - license-checks.xml | 10 - pom.xml | 199 - .../clirr-ignored-differences.xml | 19 - proto-google-cloud-language-v1/pom.xml | 34 - .../language/v1/AnalyzeEntitiesRequest.java | 877 --- .../v1/AnalyzeEntitiesRequestOrBuilder.java | 91 - .../language/v1/AnalyzeEntitiesResponse.java | 1117 ---- .../v1/AnalyzeEntitiesResponseOrBuilder.java | 105 - .../v1/AnalyzeEntitySentimentRequest.java | 878 --- ...nalyzeEntitySentimentRequestOrBuilder.java | 91 - .../v1/AnalyzeEntitySentimentResponse.java | 1119 ---- ...alyzeEntitySentimentResponseOrBuilder.java | 105 - .../language/v1/AnalyzeSentimentRequest.java | 877 --- .../v1/AnalyzeSentimentRequestOrBuilder.java | 91 - .../language/v1/AnalyzeSentimentResponse.java | 1387 ----- .../v1/AnalyzeSentimentResponseOrBuilder.java | 141 - .../language/v1/AnalyzeSyntaxRequest.java | 877 --- .../v1/AnalyzeSyntaxRequestOrBuilder.java | 91 - .../language/v1/AnalyzeSyntaxResponse.java | 1602 ----- .../v1/AnalyzeSyntaxResponseOrBuilder.java | 157 - .../language/v1/AnnotateTextRequest.java | 2477 -------- .../v1/AnnotateTextRequestOrBuilder.java | 132 - .../language/v1/AnnotateTextResponse.java | 2980 ---------- .../v1/AnnotateTextResponseOrBuilder.java | 323 - .../language/v1/ClassificationCategory.java | 718 --- .../v1/ClassificationCategoryOrBuilder.java | 66 - .../v1/ClassificationModelOptions.java | 2417 -------- .../ClassificationModelOptionsOrBuilder.java | 106 - .../language/v1/ClassifyTextRequest.java | 1029 ---- .../v1/ClassifyTextRequestOrBuilder.java | 108 - .../language/v1/ClassifyTextResponse.java | 937 --- .../v1/ClassifyTextResponseOrBuilder.java | 77 - .../cloud/language/v1/DependencyEdge.java | 2615 --------- .../language/v1/DependencyEdgeOrBuilder.java | 67 - .../google/cloud/language/v1/Document.java | 1557 ----- .../cloud/language/v1/DocumentOrBuilder.java | 179 - .../cloud/language/v1/EncodingType.java | 216 - .../com/google/cloud/language/v1/Entity.java | 2473 -------- .../cloud/language/v1/EntityMention.java | 1308 ----- .../language/v1/EntityMentionOrBuilder.java | 129 - .../cloud/language/v1/EntityOrBuilder.java | 267 - .../language/v1/LanguageServiceProto.java | 630 -- .../cloud/language/v1/PartOfSpeech.java | 5148 ---------------- .../language/v1/PartOfSpeechOrBuilder.java | 325 -- .../google/cloud/language/v1/Sentence.java | 985 ---- .../cloud/language/v1/SentenceOrBuilder.java | 101 - .../google/cloud/language/v1/Sentiment.java | 632 -- .../cloud/language/v1/SentimentOrBuilder.java | 54 - .../google/cloud/language/v1/TextSpan.java | 707 --- .../cloud/language/v1/TextSpanOrBuilder.java | 64 - .../com/google/cloud/language/v1/Token.java | 1408 ----- .../cloud/language/v1/TokenOrBuilder.java | 155 - .../cloud/language/v1/language_service.proto | 1175 ---- .../clirr-ignored-differences.xml | 19 - proto-google-cloud-language-v1beta2/pom.xml | 34 - .../v1beta2/AnalyzeEntitiesRequest.java | 878 --- .../AnalyzeEntitiesRequestOrBuilder.java | 91 - .../v1beta2/AnalyzeEntitiesResponse.java | 1119 ---- .../AnalyzeEntitiesResponseOrBuilder.java | 106 - .../AnalyzeEntitySentimentRequest.java | 884 --- ...nalyzeEntitySentimentRequestOrBuilder.java | 91 - .../AnalyzeEntitySentimentResponse.java | 1126 ---- ...alyzeEntitySentimentResponseOrBuilder.java | 106 - .../v1beta2/AnalyzeSentimentRequest.java | 885 --- .../AnalyzeSentimentRequestOrBuilder.java | 93 - .../v1beta2/AnalyzeSentimentResponse.java | 1390 ----- .../AnalyzeSentimentResponseOrBuilder.java | 141 - .../v1beta2/AnalyzeSyntaxRequest.java | 878 --- .../AnalyzeSyntaxRequestOrBuilder.java | 91 - .../v1beta2/AnalyzeSyntaxResponse.java | 1606 ----- .../AnalyzeSyntaxResponseOrBuilder.java | 158 - .../language/v1beta2/AnnotateTextRequest.java | 2514 -------- .../v1beta2/AnnotateTextRequestOrBuilder.java | 132 - .../v1beta2/AnnotateTextResponse.java | 2992 ---------- .../AnnotateTextResponseOrBuilder.java | 326 -- .../v1beta2/ClassificationCategory.java | 719 --- .../ClassificationCategoryOrBuilder.java | 66 - .../v1beta2/ClassificationModelOptions.java | 2445 -------- .../ClassificationModelOptionsOrBuilder.java | 109 - .../language/v1beta2/ClassifyTextRequest.java | 1045 ---- .../v1beta2/ClassifyTextRequestOrBuilder.java | 111 - .../v1beta2/ClassifyTextResponse.java | 945 --- .../ClassifyTextResponseOrBuilder.java | 78 - .../language/v1beta2/DependencyEdge.java | 2614 --------- .../v1beta2/DependencyEdgeOrBuilder.java | 67 - .../cloud/language/v1beta2/Document.java | 2089 ------- .../language/v1beta2/DocumentOrBuilder.java | 237 - .../cloud/language/v1beta2/EncodingType.java | 218 - .../google/cloud/language/v1beta2/Entity.java | 2480 -------- .../cloud/language/v1beta2/EntityMention.java | 1318 ----- .../v1beta2/EntityMentionOrBuilder.java | 129 - .../language/v1beta2/EntityOrBuilder.java | 267 - .../v1beta2/LanguageServiceProto.java | 651 --- .../cloud/language/v1beta2/PartOfSpeech.java | 5191 ----------------- .../v1beta2/PartOfSpeechOrBuilder.java | 325 -- .../cloud/language/v1beta2/Sentence.java | 992 ---- .../language/v1beta2/SentenceOrBuilder.java | 101 - .../cloud/language/v1beta2/Sentiment.java | 635 -- .../language/v1beta2/SentimentOrBuilder.java | 54 - .../cloud/language/v1beta2/TextSpan.java | 709 --- .../language/v1beta2/TextSpanOrBuilder.java | 64 - .../google/cloud/language/v1beta2/Token.java | 1414 ----- .../language/v1beta2/TokenOrBuilder.java | 155 - .../language/v1beta2/language_service.proto | 1199 ---- renovate.json | 76 - samples/install-without-bom/pom.xml | 84 - samples/pom.xml | 56 - samples/snapshot/pom.xml | 83 - .../analyzeentities/AsyncAnalyzeEntities.java | 52 - .../analyzeentities/SyncAnalyzeEntities.java | 48 - .../SyncAnalyzeEntitiesDocument.java | 42 - ...ncAnalyzeEntitiesDocumentEncodingtype.java | 45 - .../AsyncAnalyzeEntitySentiment.java | 52 - .../SyncAnalyzeEntitySentiment.java | 49 - .../SyncAnalyzeEntitySentimentDocument.java | 43 - ...zeEntitySentimentDocumentEncodingtype.java | 45 - .../AsyncAnalyzeSentiment.java | 52 - .../SyncAnalyzeSentiment.java | 48 - .../SyncAnalyzeSentimentDocument.java | 42 - ...cAnalyzeSentimentDocumentEncodingtype.java | 45 - .../analyzesyntax/AsyncAnalyzeSyntax.java | 52 - .../analyzesyntax/SyncAnalyzeSyntax.java | 48 - .../SyncAnalyzeSyntaxDocument.java | 42 - ...SyncAnalyzeSyntaxDocumentEncodingtype.java | 44 - .../annotatetext/AsyncAnnotateText.java | 53 - .../annotatetext/SyncAnnotateText.java | 49 - ...xtDocumentAnnotatetextrequestfeatures.java | 44 - ...notatetextrequestfeaturesEncodingtype.java | 48 - .../classifytext/AsyncClassifyText.java | 52 - .../classifytext/SyncClassifyText.java | 48 - .../SyncClassifyTextDocument.java | 42 - .../SyncCreateSetCredentialsProvider.java | 45 - .../SyncCreateSetCredentialsProvider1.java | 41 - .../create/SyncCreateSetEndpoint.java | 42 - .../SyncAnalyzeSentiment.java | 46 - .../SyncAnalyzeSentiment.java | 46 - .../analyzeentities/AsyncAnalyzeEntities.java | 52 - .../analyzeentities/SyncAnalyzeEntities.java | 48 - .../SyncAnalyzeEntitiesDocument.java | 42 - ...ncAnalyzeEntitiesDocumentEncodingtype.java | 45 - .../AsyncAnalyzeEntitySentiment.java | 52 - .../SyncAnalyzeEntitySentiment.java | 49 - .../SyncAnalyzeEntitySentimentDocument.java | 43 - ...zeEntitySentimentDocumentEncodingtype.java | 45 - .../AsyncAnalyzeSentiment.java | 52 - .../SyncAnalyzeSentiment.java | 48 - .../SyncAnalyzeSentimentDocument.java | 42 - ...cAnalyzeSentimentDocumentEncodingtype.java | 45 - .../analyzesyntax/AsyncAnalyzeSyntax.java | 52 - .../analyzesyntax/SyncAnalyzeSyntax.java | 48 - .../SyncAnalyzeSyntaxDocument.java | 42 - ...SyncAnalyzeSyntaxDocumentEncodingtype.java | 44 - .../annotatetext/AsyncAnnotateText.java | 53 - .../annotatetext/SyncAnnotateText.java | 49 - ...xtDocumentAnnotatetextrequestfeatures.java | 44 - ...notatetextrequestfeaturesEncodingtype.java | 48 - .../classifytext/AsyncClassifyText.java | 52 - .../classifytext/SyncClassifyText.java | 48 - .../SyncClassifyTextDocument.java | 42 - .../SyncCreateSetCredentialsProvider.java | 45 - .../SyncCreateSetCredentialsProvider1.java | 41 - .../create/SyncCreateSetEndpoint.java | 42 - .../SyncAnalyzeSentiment.java | 46 - .../SyncAnalyzeSentiment.java | 46 - samples/snippets/pom.xml | 60 - .../beta/example/language/AnalyzeBeta.java | 132 - .../beta/example/language/AnalyzeBetaIT.java | 79 - synth.metadata | 248 - versions.txt | 8 - 278 files changed, 100617 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/support_request.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/auto-label.yaml delete mode 100644 .github/blunderbuss.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/generated-files-bot.yml delete mode 100644 .github/snippet-bot.yml delete mode 100644 .github/sync-repo-settings.yaml delete mode 100644 .github/trusted-contribution.yml delete mode 100644 .github/workflows/approve-readme.yaml delete mode 100644 .github/workflows/auto-release.yaml delete mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/samples.yaml delete mode 100644 .gitignore delete mode 100644 .kokoro/build.bat delete mode 100755 .kokoro/build.sh delete mode 100755 .kokoro/coerce_logs.sh delete mode 100644 .kokoro/common.cfg delete mode 100644 .kokoro/common.sh delete mode 100644 .kokoro/continuous/common.cfg delete mode 100644 .kokoro/continuous/java8.cfg delete mode 100755 .kokoro/continuous/propose_release.sh delete mode 100755 .kokoro/dependencies.sh delete mode 100644 .kokoro/nightly/common.cfg delete mode 100644 .kokoro/nightly/integration.cfg delete mode 100644 .kokoro/nightly/java11-integration.cfg delete mode 100644 .kokoro/nightly/java11.cfg delete mode 100644 .kokoro/nightly/java7.cfg delete mode 100644 .kokoro/nightly/java8-osx.cfg delete mode 100644 .kokoro/nightly/java8-win.cfg delete mode 100644 .kokoro/nightly/java8.cfg delete mode 100644 .kokoro/nightly/samples.cfg delete mode 100755 .kokoro/populate-secrets.sh delete mode 100644 .kokoro/presubmit/clirr.cfg delete mode 100644 .kokoro/presubmit/common.cfg delete mode 100644 .kokoro/presubmit/dependencies.cfg delete mode 100644 .kokoro/presubmit/graalvm-native-17.cfg delete mode 100644 .kokoro/presubmit/graalvm-native.cfg delete mode 100644 .kokoro/presubmit/integration.cfg delete mode 100644 .kokoro/presubmit/java11.cfg delete mode 100644 .kokoro/presubmit/java7.cfg delete mode 100644 .kokoro/presubmit/java8-osx.cfg delete mode 100644 .kokoro/presubmit/java8-win.cfg delete mode 100644 .kokoro/presubmit/java8.cfg delete mode 100644 .kokoro/presubmit/linkage-monitor.cfg delete mode 100644 .kokoro/presubmit/lint.cfg delete mode 100644 .kokoro/presubmit/samples.cfg delete mode 100755 .kokoro/readme.sh delete mode 100644 .kokoro/release/bump_snapshot.cfg delete mode 100755 .kokoro/release/bump_snapshot.sh delete mode 100644 .kokoro/release/common.cfg delete mode 100755 .kokoro/release/common.sh delete mode 100644 .kokoro/release/drop.cfg delete mode 100755 .kokoro/release/drop.sh delete mode 100644 .kokoro/release/promote.cfg delete mode 100755 .kokoro/release/promote.sh delete mode 100644 .kokoro/release/publish_javadoc.cfg delete mode 100755 .kokoro/release/publish_javadoc.sh delete mode 100644 .kokoro/release/publish_javadoc11.cfg delete mode 100755 .kokoro/release/publish_javadoc11.sh delete mode 100644 .kokoro/release/snapshot.cfg delete mode 100755 .kokoro/release/snapshot.sh delete mode 100644 .kokoro/release/stage.cfg delete mode 100755 .kokoro/release/stage.sh delete mode 100644 .kokoro/requirements.in delete mode 100644 .kokoro/requirements.txt delete mode 100644 .kokoro/trampoline.sh delete mode 100644 .readme-partials.yaml delete mode 100644 .repo-metadata.json delete mode 100644 CHANGELOG.md delete mode 100644 codecov.yaml delete mode 100644 google-cloud-language-bom/pom.xml delete mode 100644 google-cloud-language/pom.xml delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/gapic_metadata.json delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceCallableFactory.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceStub.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceCallableFactory.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStub.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/gapic_metadata.json delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceCallableFactory.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceStub.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceCallableFactory.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStub.java delete mode 100644 google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientHttpJsonTest.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageService.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageServiceImpl.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientHttpJsonTest.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientTest.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageService.java delete mode 100644 google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageServiceImpl.java delete mode 100644 grpc-google-cloud-language-v1/pom.xml delete mode 100644 grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java delete mode 100644 grpc-google-cloud-language-v1beta2/pom.xml delete mode 100644 grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java delete mode 100644 java.header delete mode 100644 license-checks.xml delete mode 100644 pom.xml delete mode 100644 proto-google-cloud-language-v1/clirr-ignored-differences.xml delete mode 100644 proto-google-cloud-language-v1/pom.xml delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategoryOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdgeOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DocumentOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EncodingType.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/PartOfSpeech.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/PartOfSpeechOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentiment.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentimentOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Token.java delete mode 100644 proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TokenOrBuilder.java delete mode 100644 proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto delete mode 100644 proto-google-cloud-language-v1beta2/clirr-ignored-differences.xml delete mode 100644 proto-google-cloud-language-v1beta2/pom.xml delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesRequest.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesResponse.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitiesResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentRequest.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentResponse.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeEntitySentimentResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentRequest.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentResponse.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSentimentResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxRequest.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxResponse.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnalyzeSyntaxResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextResponse.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationCategory.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationCategoryOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextResponse.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextResponseOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DependencyEdge.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DependencyEdgeOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EncodingType.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Entity.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityMention.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityMentionOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/EntityOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/PartOfSpeech.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/PartOfSpeechOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentence.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/SentenceOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Sentiment.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/SentimentOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TextSpan.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TextSpanOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Token.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/TokenOrBuilder.java delete mode 100644 proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto delete mode 100644 renovate.json delete mode 100644 samples/install-without-bom/pom.xml delete mode 100644 samples/pom.xml delete mode 100644 samples/snapshot/pom.xml delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/AsyncAnalyzeEntities.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntities.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntax.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/AsyncAnnotateText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/AsyncClassifyText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/classifytext/SyncClassifyTextDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservice/create/SyncCreateSetEndpoint.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/AsyncAnalyzeEntities.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntities.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentities/SyncAnalyzeEntitiesDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/AsyncAnalyzeEntitySentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzeentitysentiment/SyncAnalyzeEntitySentimentDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/AsyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesentiment/SyncAnalyzeSentimentDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/AsyncAnalyzeSyntax.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntax.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/analyzesyntax/SyncAnalyzeSyntaxDocumentEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/AsyncAnnotateText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeatures.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/annotatetext/SyncAnnotateTextDocumentAnnotatetextrequestfeaturesEncodingtype.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/AsyncClassifyText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyText.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/classifytext/SyncClassifyTextDocument.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservice/create/SyncCreateSetEndpoint.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/languageservicesettings/analyzesentiment/SyncAnalyzeSentiment.java delete mode 100644 samples/snippets/generated/com/google/cloud/language/v1beta2/stub/languageservicestubsettings/analyzesentiment/SyncAnalyzeSentiment.java delete mode 100644 samples/snippets/pom.xml delete mode 100644 samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java delete mode 100644 samples/snippets/src/test/java/beta/example/language/AnalyzeBetaIT.java delete mode 100644 synth.metadata delete mode 100644 versions.txt diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index db2d8ad1..00000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,13 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. - -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -* @googleapis/yoshi-java - -# The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/java-samples-reviewers - -# Generated snippets should not be owned by samples reviewers -samples/snippets/generated/ @googleapis/yoshi-java diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index bfa0d3df..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -:bus: This library has moved to -[google-cloud-java/java-language]( -https://github.com/googleapis/google-cloud-java/tree/main/java-language). -This repository will be archived in the future. - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -Please run down the following list and make sure you've tried the usual "quick fixes": - - - Search the issues already opened: https://github.com/googleapis/java-language/issues - - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform - -If you are still having issues, please include as much information as possible: - -#### Environment details - -1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). - General, Core, and Other are also allowed as types -2. OS type and version: -3. Java version: -4. version(s): - -#### Steps to reproduce - - 1. ? - 2. ? - -#### Code example - -```java -// example -``` - -#### Stack trace -``` -Any relevant stacktrace here. -``` - -#### External references such as API reference guides - -- ? - -#### Any additional information below - - -Following these steps guarantees the quickest resolution possible. - -Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index eee02c5e..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this library - ---- - -:bus: This library has moved to -[google-cloud-java/java-language]( -https://github.com/googleapis/google-cloud-java/tree/main/java-language). -This repository will be archived in the future. - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -**Is your feature request related to a problem? Please describe.** -What the problem is. Example: I'm always frustrated when [...] - -**Describe the solution you'd like** -What you want to happen. - -**Describe alternatives you've considered** -Any alternative solutions or features you've considered. - -**Additional context** -Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md deleted file mode 100644 index 99586903..00000000 --- a/.github/ISSUE_TEMPLATE/support_request.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Support request -about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. - ---- - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index c05124e3..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,10 +0,0 @@ -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-language/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea -- [ ] Ensure the tests and linter pass -- [ ] Code coverage does not decrease (if any source code was changed) -- [ ] Appropriate docs were updated (if necessary) - -Fixes # β˜•οΈ - -If you write sample code, please follow the [samples format]( -https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml deleted file mode 100644 index 4caef688..00000000 --- a/.github/auto-label.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -requestsize: - enabled: true diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml deleted file mode 100644 index 2176b054..00000000 --- a/.github/blunderbuss.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss -assign_prs_by: -- labels: - - samples - to: - - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index c8f413b0..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "maven" - directory: "/" - schedule: - interval: "daily" - # Disable version updates for Maven dependencies - open-pull-requests-limit: 0 - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - # Disable version updates for pip dependencies - open-pull-requests-limit: 0 \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml deleted file mode 100644 index c644a24e..00000000 --- a/.github/generated-files-bot.yml +++ /dev/null @@ -1,12 +0,0 @@ -externalManifests: -- type: json - file: 'synth.metadata' - jsonpath: '$.generatedFiles[*]' -- type: json - file: '.github/readme/synth.metadata/synth.metadata' - jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' -- 'gcf-owl-bot[bot]' diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml deleted file mode 100644 index 0501f63f..00000000 --- a/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,42 +0,0 @@ -rebaseMergeAllowed: false -squashMergeAllowed: true -mergeCommitAllowed: false -branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - 'Kokoro - Test: Java GraalVM Native Image' - - 'Kokoro - Test: Java 17 GraalVM Native Image' - - pattern: java7 - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor -permissionRules: - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin - - team: yoshi-java - permission: push diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml deleted file mode 100644 index a0ba1f7d..00000000 --- a/.github/trusted-contribution.yml +++ /dev/null @@ -1,3 +0,0 @@ -trustedContributors: -- renovate-bot -- gcf-owl-bot[bot] diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml deleted file mode 100644 index f5fc7d51..00000000 --- a/.github/workflows/approve-readme.yaml +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: - pull_request: -name: auto-merge-readme -jobs: - approve: - runs-on: ubuntu-latest - if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' - steps: - - uses: actions/github-script@v6 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - script: | - // only approve PRs from yoshi-automation - if (context.payload.pull_request.user.login !== "yoshi-automation") { - return; - } - - // only approve PRs like "chore: release " - if (!context.payload.pull_request.title === "chore: regenerate README") { - return; - } - - // only approve PRs with README.md and synth.metadata changes - const files = new Set( - ( - await github.paginate( - github.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }) - ) - ).map(file => file.filename) - ); - if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { - return; - } - - // approve README regeneration PR - await github.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped PR!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach automerge label - await github.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['automerge'] - }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml deleted file mode 100644 index 7a106d00..00000000 --- a/.github/workflows/auto-release.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: - pull_request: -name: auto-release -jobs: - approve: - runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') - steps: - - uses: actions/github-script@v6 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - debug: true - script: | - // only approve PRs from release-please[bot] - if (context.payload.pull_request.user.login !== "release-please[bot]") { - return; - } - - // only approve PRs like "chore(main): release " - if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { - return; - } - - // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.rest.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }); - const changed_files = await github.paginate(filesPromise) - - if ( changed_files.length < 1 ) { - console.log( "Not proceeding since PR is empty!" ) - return; - } - - if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { - console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) - return; - } - - // trigger auto-release when - // 1) it is a SNAPSHOT release (auto-generated post regular release) - // 2) there are dependency updates only - // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) - if ( - context.payload.pull_request.body.includes("Fix") || - context.payload.pull_request.body.includes("Build") || - context.payload.pull_request.body.includes("Documentation") || - context.payload.pull_request.body.includes("BREAKING CHANGES") || - context.payload.pull_request.body.includes("Features") - ) { - console.log( "Not auto-releasing since it is not a dependency-update-only release." ); - return; - } - - const promise = github.rest.pulls.list.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - const open_pulls = await github.paginate(promise) - - if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { - for ( const pull of open_pulls ) { - if ( pull.title.startsWith("deps: update dependency") ) { - console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); - return; - } - } - } - - // approve release PR - await github.rest.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped release!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach kokoro:force-run and automerge labels - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['kokoro:force-run', 'automerge'] - }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index e3bb26e3..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: - push: - branches: - - main - pull_request: -name: ci -jobs: - units: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java: [8, 11, 17] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: test - windows: - runs-on: windows-latest - steps: - - name: Support longpaths - run: git config --system core.longpaths true - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.bat - env: - JOB_TYPE: test - dependencies: - runs-on: ubuntu-latest - strategy: - matrix: - java: [8, 11, 17] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/dependencies.sh - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 11 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: lint - clirr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml deleted file mode 100644 index 912ed8b2..00000000 --- a/.github/workflows/samples.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: - pull_request: -name: samples -jobs: - checkstyle: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - name: Run checkstyle - run: mvn -P lint --quiet --batch-mode checkstyle:check - working-directory: samples/snippets diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 598779ba..00000000 --- a/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -.gitignore - -# Packages -dist -bin -var -sdist -target - -# Unit test / coverage reports -.coverage -.tox -nosetests.xml - -# Translations -*.mo - -# Mr Developer -.mr.developer.cfg - -.metadata -.project -.pydevproject -*.iml -.idea -.settings -.DS_Store -.classpath - -# Built documentation -docs/ - - -# Wheel directory used in Travis builds. -gcloud-java-wheels/ -src/test/resources/gcd-head.zip -src/test/resources/gcd-v1beta2-rev1-2.1.1.zip - -# API key file containing value of GOOGLE_API_KEY for integration tests -api_key - -# Python utilities -*.pyc -artman-genfiles -venv - -.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat deleted file mode 100644 index 067cf4a4..00000000 --- a/.kokoro/build.bat +++ /dev/null @@ -1,18 +0,0 @@ -:: Copyright 2022 Google LLC -:: -:: Licensed under the Apache License, Version 2.0 (the "License"); -:: you may not use this file except in compliance with the License. -:: You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, software -:: distributed under the License is distributed on an "AS IS" BASIS, -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -:: See the License for the specific language governing permissions and -:: limitations under the License. -:: Github action job to test core java library features on -:: downstream client libraries before they are released. -:: See documentation in type-shell-output.bat - -"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh deleted file mode 100755 index 9f2fbca4..00000000 --- a/.kokoro/build.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Maven & Java version -mvn -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C - -# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it -if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then - export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) -fi - -RETURN_CODE=0 -set +e - -case ${JOB_TYPE} in -test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true - RETURN_CODE=$? - ;; -lint) - mvn com.coveo:fmt-maven-plugin:check -B -ntp - RETURN_CODE=$? - ;; -javadoc) - mvn javadoc:javadoc javadoc:test-javadoc -B -ntp - RETURN_CODE=$? - ;; -integration) - mvn -B ${INTEGRATION_TEST_ARGS} \ - -ntp \ - -Penable-integration-tests \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - ;; -graalvm) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test - RETURN_CODE=$? - ;; -graalvm17) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test - RETURN_CODE=$? - ;; -samples) - SAMPLES_DIR=samples - # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. - if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] - then - SAMPLES_DIR=samples/snapshot - fi - - if [[ -f ${SAMPLES_DIR}/pom.xml ]] - then - for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do - [[ -f "$FILE" ]] || continue - source "$FILE" - done - - pushd ${SAMPLES_DIR} - mvn -B \ - -ntp \ - -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 -ntp -Denforcer.skip=true clirr:check - RETURN_CODE=$? - ;; -*) - ;; -esac - -if [ "${REPORT_COVERAGE}" == "true" ] -then - bash ${KOKORO_GFILE_DIR}/codecov.sh -fi - -# fix output location of logs -bash .kokoro/coerce_logs.sh - -if [[ "${ENABLE_FLAKYBOT}" == "true" ]] -then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot - ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-language -fi - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh deleted file mode 100755 index 46edbf7f..00000000 --- a/.kokoro/coerce_logs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script finds and moves sponge logs so that they can be found by placer -# and are not flagged as flaky by sponge. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -job=$(basename ${KOKORO_JOB_NAME}) - -echo "coercing sponge logs..." -for xml in `find . -name *-sponge_log.xml` -do - class=$(basename ${xml} | cut -d- -f2) - dir=$(dirname ${xml})/${job}/${class} - text=$(dirname ${xml})/${class}-sponge_log.txt - mkdir -p ${dir} - mv ${xml} ${dir}/sponge_log.xml - mv ${text} ${dir}/sponge_log.txt -done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg deleted file mode 100644 index 15472d99..00000000 --- a/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "java-language/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/build.sh" -} diff --git a/.kokoro/common.sh b/.kokoro/common.sh deleted file mode 100644 index f8f957af..00000000 --- a/.kokoro/common.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function retry_with_backoff { - attempts_left=$1 - sleep_seconds=$2 - shift 2 - command=$@ - - - # store current flag state - flags=$- - - # allow a failures to continue - set +e - ${command} - exit_code=$? - - # restore "e" flag - if [[ ${flags} =~ e ]] - then set -e - else set +e - fi - - if [[ $exit_code == 0 ]] - then - return 0 - fi - - # failure - if [[ ${attempts_left} > 0 ]] - then - echo "failure (${exit_code}), sleeping ${sleep_seconds}..." - sleep ${sleep_seconds} - new_attempts=$((${attempts_left} - 1)) - new_sleep=$((${sleep_seconds} * 2)) - retry_with_backoff ${new_attempts} ${new_sleep} ${command} - fi - - return $exit_code -} - -## Helper functionss -function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } -function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } - -## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg deleted file mode 100644 index 32327b22..00000000 --- a/.kokoro/continuous/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-language/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7ba..00000000 --- a/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/continuous/propose_release.sh b/.kokoro/continuous/propose_release.sh deleted file mode 100755 index 3a700fb7..00000000 --- a/.kokoro/continuous/propose_release.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - # Groom the release PR as new commits are merged. - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/java-language \ - --package-name="language" \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ - --release-type=java-yoshi -fi diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh deleted file mode 100755 index bd896024..00000000 --- a/.kokoro/dependencies.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -shopt -s nullglob - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java -java -version -echo $JOB_TYPE - -function determineMavenOpts() { - local javaVersion=$( - # filter down to the version line, then pull out the version between quotes, - # then trim the version number down to its minimal number (removing any - # update or suffix number). - java -version 2>&1 | grep "version" \ - | sed -E 's/^.*"(.*?)".*$/\1/g' \ - | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' - ) - - if [[ $javaVersion == 17* ]] - then - # MaxPermSize is no longer supported as of jdk 17 - echo -n "-Xmx1024m" - else - echo -n "-Xmx1024m -XX:MaxPermSize=128m" - fi -} - -export MAVEN_OPTS=$(determineMavenOpts) - -# this should run maven enforcer -retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ - -DskipTests=true \ - -Dmaven.javadoc.skip=true \ - -Dclirr.skip=true - -mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg deleted file mode 100644 index 32327b22..00000000 --- a/.kokoro/nightly/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-language/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg deleted file mode 100644 index bd0297a3..00000000 --- a/.kokoro/nightly/integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "false" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg deleted file mode 100644 index dc51b65e..00000000 --- a/.kokoro/nightly/java11-integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/java11014" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "false" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg deleted file mode 100644 index 709f2b4c..00000000 --- a/.kokoro/nightly/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg deleted file mode 100644 index cb24f44e..00000000 --- a/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg deleted file mode 100644 index b997ec12..00000000 --- a/.kokoro/nightly/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-language/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index 3467576b..00000000 --- a/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-language/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg deleted file mode 100644 index 495cc7ba..00000000 --- a/.kokoro/nightly/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg deleted file mode 100644 index fee6a838..00000000 --- a/.kokoro/nightly/samples.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "false" -} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh deleted file mode 100755 index f5251425..00000000 --- a/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} -function msg { println "$*" >&2 ;} -function println { printf '%s\n' "$(now) $*" ;} - - -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com -SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" -msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" -mkdir -p ${SECRET_LOCATION} -for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") -do - msg "Retrieving secret ${key}" - docker run --entrypoint=gcloud \ - --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ - gcr.io/google.com/cloudsdktool/cloud-sdk \ - secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ - --secret ${key} > \ - "${SECRET_LOCATION}/${key}" - if [[ $? == 0 ]]; then - msg "Secret written to ${SECRET_LOCATION}/${key}" - else - msg "Error retrieving secret ${key}" - fi -done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg deleted file mode 100644 index ec572442..00000000 --- a/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "clirr" -} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg deleted file mode 100644 index f1df1a74..00000000 --- a/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-language/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg deleted file mode 100644 index 4c9512de..00000000 --- a/.kokoro/presubmit/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/dependencies.sh" -} diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg deleted file mode 100644 index e20330c3..00000000 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" -} - -env_vars: { - key: "JOB_TYPE" - value: "graalvm17" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg deleted file mode 100644 index 0fd6ba2f..00000000 --- a/.kokoro/presubmit/graalvm-native.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" -} - -env_vars: { - key: "JOB_TYPE" - value: "graalvm" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg deleted file mode 100644 index dded67a9..00000000 --- a/.kokoro/presubmit/integration.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg deleted file mode 100644 index 709f2b4c..00000000 --- a/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg deleted file mode 100644 index cb24f44e..00000000 --- a/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg deleted file mode 100644 index b997ec12..00000000 --- a/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-language/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index 3467576b..00000000 --- a/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-language/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7ba..00000000 --- a/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg deleted file mode 100644 index 2557f21b..00000000 --- a/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8a..00000000 --- a/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg deleted file mode 100644 index 01e09600..00000000 --- a/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} \ No newline at end of file diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh deleted file mode 100755 index 691cc225..00000000 --- a/.kokoro/readme.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -cd ${KOKORO_ARTIFACTS_DIR}/github/java-language - -# Disable buffering, so that the logs stream through. -export PYTHONUNBUFFERED=1 - -# Kokoro exposes this as a file, but the scripts expect just a plain variable. -export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) - -# Setup git credentials -echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials -git config --global credential.helper 'store --file ~/.git-credentials' - -python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool - -set +e -python3.6 -m autosynth.synth \ - --repository=googleapis/java-language \ - --synth-file-name=.github/readme/synth.py \ - --metadata-path=.github/readme/synth.metadata \ - --pr-title="chore: regenerate README" \ - --branch-suffix="readme" - -# autosynth returns 28 to signal there are no changes -RETURN_CODE=$? -if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] -then - exit ${RETURN_CODE} -fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index df993e89..00000000 --- a/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-language/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/.kokoro/release/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh deleted file mode 100755 index 93e355b3..00000000 --- a/.kokoro/release/bump_snapshot.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - # Groom the snapshot release PR immediately after publishing a release - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/java-language \ - --package-name="language" \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ - --snapshot \ - --release-type=java-auth-yoshi -fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg deleted file mode 100644 index 15ba45e0..00000000 --- a/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-language/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh deleted file mode 100755 index 7f78ee41..00000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg deleted file mode 100644 index 29f8cc29..00000000 --- a/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/drop.sh" -} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh deleted file mode 100755 index 742ec1a8..00000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:drop -B \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg deleted file mode 100644 index e90caecd..00000000 --- a/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/promote.sh" -} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh deleted file mode 100755 index 3cac3d8a..00000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh - -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index 38aef0fc..00000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index c82ad4b7..00000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-language -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn site -B -q - -pushd target/site/apidocs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index 0ffdaa0b..00000000 --- a/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 2e830792..00000000 --- a/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-language -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# cloud RAD generation -mvn clean javadoc:aggregate -B -q -P docFX -# include CHANGELOG -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg deleted file mode 100644 index 82846877..00000000 --- a/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh deleted file mode 100755 index 1f55b770..00000000 --- a/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg deleted file mode 100644 index 19ad0d7c..00000000 --- a/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-language/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-language/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-language" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh deleted file mode 100755 index 61e714d6..00000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Start the releasetool reporter -requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) -python3 -m pip install --require-hashes -r $requirementsFile -python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script - -source $(dirname "$0")/common.sh -source $(dirname "$0")/../common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -# attempt to stage 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -Dclirr.skip=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} - -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml -fi diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in deleted file mode 100644 index 2092cc74..00000000 --- a/.kokoro/requirements.in +++ /dev/null @@ -1,6 +0,0 @@ -gcp-docuploader -gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x -wheel -setuptools -typing-extensions -click<8.1.0 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt deleted file mode 100644 index c80f0a87..00000000 --- a/.kokoro/requirements.txt +++ /dev/null @@ -1,403 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --allow-unsafe --generate-hashes requirements.in -# -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via google-auth -certifi==2022.12.7 \ - --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ - --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 - # via requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==39.0.1 \ - --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ - --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ - --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ - --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ - --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ - --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ - --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ - --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ - --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ - --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ - --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ - --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ - --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ - --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ - --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ - --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ - --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ - --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ - --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ - --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ - --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 - # via - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.4 \ - --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ - --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf - # via -r requirements.in -gcp-releasetool==1.10.5 \ - --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ - --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 - # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 - # via - # google-cloud-core - # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:ccaa901f31ad5cbb562615eb8b664b3dd0bf5404a67618e642307f00613eda4d \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 - # via - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 - # via keyring -jeepney==0.8.0 \ - --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ - --hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755 - # via - # keyring - # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via gcp-releasetool -protobuf==3.20.2 \ - --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ - --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ - --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ - --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ - --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ - --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ - --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ - --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ - --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ - --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ - --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ - --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ - --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ - --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ - --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ - --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ - --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ - --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ - --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ - --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ - --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ - --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 - # via - # gcp-docuploader - # gcp-releasetool - # google-api-core - # google-cloud-storage -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d - # via - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -setuptools==67.3.2 \ - --hash=sha256:95f00380ef2ffa41d9bba85d95b27689d923c93dfbafed4aecd7cf988a25e012 \ - --hash=sha256:bb6d8e508de562768f2027902929f8523932fcd1fb784e6d573d2cafac995a48 - # via -r requirements.in -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.4.0 \ - --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ - --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e - # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via requests -wheel==0.38.4 \ - --hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \ - --hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8 - # via -r requirements.in -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via importlib-metadata diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh deleted file mode 100644 index 8b69b793..00000000 --- a/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -eo pipefail -# Always run the cleanup script, regardless of the success of bouncing into -# the container. -function cleanup() { - chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - echo "cleanup"; -} -trap cleanup EXIT - -$(dirname $0)/populate-secrets.sh # Secret Manager secrets. -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.readme-partials.yaml b/.readme-partials.yaml deleted file mode 100644 index 272901e8..00000000 --- a/.readme-partials.yaml +++ /dev/null @@ -1,33 +0,0 @@ -custom_content: | - #### Analyzing sentiment - With Cloud Natural Language, you can analyze the sentiment of text. Add the following imports at the top of your file: - - ``` java - import com.google.cloud.language.v1.LanguageServiceClient; - import com.google.cloud.language.v1.Document; - import com.google.cloud.language.v1.Document.Type; - import com.google.cloud.language.v1.Sentiment; - ``` - Then, to analyze the sentiment of some text, use the following code: - - ``` java - // Instantiates a client - LanguageServiceClient language = LanguageServiceClient.create(); - - // The text to analyze - String[] texts = {"I love this!", "I hate this!"}; - for (String text : texts) { - Document doc = Document.newBuilder().setContent(text).setType(Type.PLAIN_TEXT).build(); - // Detects the sentiment of the text - Sentiment sentiment = language.analyzeSentiment(doc).getDocumentSentiment(); - - System.out.printf("Text: \"%s\"%n", text); - System.out.printf( - "Sentiment: score = %s, magnitude = %s%n", - sentiment.getScore(), sentiment.getMagnitude()); - } - ``` - - #### Complete source code - - In [AnalyzeSentiment.java](https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-examples/src/main/java/com/google/cloud/examples/language/snippets/AnalyzeSentiment.java) we put the code shown above into a complete program. \ No newline at end of file diff --git a/.repo-metadata.json b/.repo-metadata.json deleted file mode 100644 index 4401b301..00000000 --- a/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_shortname": "language", - "name_pretty": "Natural Language", - "product_documentation": "https://cloud.google.com/natural-language/docs/", - "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-language/latest/history", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559753", - "release_level": "stable", - "language": "java", - "repo": "googleapis/java-language", - "repo_short": "java-language", - "distribution_name": "com.google.cloud:google-cloud-language", - "api_id": "language.googleapis.com", - "transport": "grpc", - "requires_billing": true, - "api_description": "provides natural language understanding technologies to developers, including sentiment analysis, entity analysis, entity sentiment analysis, content classification, and syntax analysis. This API is part of the larger Cloud Machine Learning API family.", - "library_type": "GAPIC_AUTO" -} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 7b0df832..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,498 +0,0 @@ -# Changelog - -## [2.4.1](https://github.com/googleapis/java-language/compare/v2.4.0...v2.4.1) (2022-10-03) - - -### Documentation - -* Update classification sample to use v2 model ([#899](https://github.com/googleapis/java-language/issues/899)) ([7b3a5f8](https://github.com/googleapis/java-language/commit/7b3a5f86b7de401198e74e76ba7af1f1599ae6cc)) - - -### Dependencies - -* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#929](https://github.com/googleapis/java-language/issues/929)) ([805563b](https://github.com/googleapis/java-language/commit/805563b083bb04bfa59ef7fc4418c6950b3340db)) -* Update dependency google-api-core to v2.10.1 ([#921](https://github.com/googleapis/java-language/issues/921)) ([8b39a51](https://github.com/googleapis/java-language/commit/8b39a51acbc452afc2bb045f6d88bbdfc46b81ed)) -* Update dependency google-auth to v2.12.0 ([#922](https://github.com/googleapis/java-language/issues/922)) ([f273003](https://github.com/googleapis/java-language/commit/f273003a294fb2d116c78f25848bd22fa8f18fc8)) -* Update dependency google-cloud-storage to v2.5.0 ([#923](https://github.com/googleapis/java-language/issues/923)) ([c34885b](https://github.com/googleapis/java-language/commit/c34885ba6ad41c8eeeeda2ad9feb20f89f67e589)) -* Update dependency google-crc32c to v1.5.0 ([#924](https://github.com/googleapis/java-language/issues/924)) ([51baceb](https://github.com/googleapis/java-language/commit/51baceb6bf821f3da41569b27cd7cdf745bd1db8)) -* Update dependency importlib-metadata to v4.12.0 ([#925](https://github.com/googleapis/java-language/issues/925)) ([a246f0d](https://github.com/googleapis/java-language/commit/a246f0dcc43ce8faeefdf998011222df294d27fa)) -* Update dependency jeepney to v0.8.0 ([#926](https://github.com/googleapis/java-language/issues/926)) ([04a307a](https://github.com/googleapis/java-language/commit/04a307ad130c3adfb2471aac551ebfc674c0d060)) - -## [2.4.0](https://github.com/googleapis/java-language/compare/v2.3.4...v2.4.0) (2022-09-26) - - -### Features - -* Add support for V1 and V2 classification models for the V1 API ([4148969](https://github.com/googleapis/java-language/commit/41489691955887daa9e00a365be6012ce4a57943)) -* Add support for V1 and V2 classification models for the V1Beta2 API ([#895](https://github.com/googleapis/java-language/issues/895)) ([4148969](https://github.com/googleapis/java-language/commit/41489691955887daa9e00a365be6012ce4a57943)) - - -### Documentation - -* Fix docstring formatting ([#897](https://github.com/googleapis/java-language/issues/897)) ([6267be8](https://github.com/googleapis/java-language/commit/6267be81ff610ef7c0c35320b032260c8b8d5db7)) - -## [2.3.4](https://github.com/googleapis/java-language/compare/v2.3.3...v2.3.4) (2022-09-15) - - -### Dependencies - -* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#890](https://github.com/googleapis/java-language/issues/890)) ([9359998](https://github.com/googleapis/java-language/commit/93599989f1b8ba59bf32c0542a1c537a3bac6a67)) - -## [2.3.3](https://github.com/googleapis/java-language/compare/v2.3.2...v2.3.3) (2022-09-08) - - -### Dependencies - -* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#885](https://github.com/googleapis/java-language/issues/885)) ([cd8a4d0](https://github.com/googleapis/java-language/commit/cd8a4d03904a15cd8994b73f179f5bff391c97fe)) - -## [2.3.2](https://github.com/googleapis/java-language/compare/v2.3.1...v2.3.2) (2022-08-09) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#874](https://github.com/googleapis/java-language/issues/874)) ([685258c](https://github.com/googleapis/java-language/commit/685258c02e634ab8f919d6806a2a3d30027ae6a1)) - -## [2.3.1](https://github.com/googleapis/java-language/compare/v2.3.0...v2.3.1) (2022-07-13) - - -### Bug Fixes - -* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-language/issues/1485)) ([#868](https://github.com/googleapis/java-language/issues/868)) ([c168587](https://github.com/googleapis/java-language/commit/c1685872ad7c6b28b0055af67ea8b0a1aff6e852)) - -## [2.3.0](https://github.com/googleapis/java-language/compare/v2.2.0...v2.3.0) (2022-07-01) - - -### Features - -* Add Java REST transport to analytics, servicecontrol, servicemanagement, serviceusage and langauge APIs ([7348caf](https://github.com/googleapis/java-language/commit/7348cafcb3df275e66126df0baa237ade8f4a9bd)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#858](https://github.com/googleapis/java-language/issues/858)) ([eb8c97f](https://github.com/googleapis/java-language/commit/eb8c97ff3ae6f7851333032be635becb3ae51961)) - -## [2.2.0](https://github.com/googleapis/java-language/compare/v2.1.11...v2.2.0) (2022-05-24) - - -### Features - -* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-language/issues/1440)) ([#847](https://github.com/googleapis/java-language/issues/847)) ([a03cdf5](https://github.com/googleapis/java-language/commit/a03cdf5c8c2fe896676513fe56ef0883f568dfdb)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#846](https://github.com/googleapis/java-language/issues/846)) ([e39dec8](https://github.com/googleapis/java-language/commit/e39dec855d4e0979523758f0bc62d4def75f0cbf)) - -### [2.1.11](https://github.com/googleapis/java-language/compare/v2.1.10...v2.1.11) (2022-04-15) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#832](https://github.com/googleapis/java-language/issues/832)) ([beb1f1e](https://github.com/googleapis/java-language/commit/beb1f1e2dddb9f0e8eea91c06d29cf15e6b71ef4)) - -### [2.1.10](https://github.com/googleapis/java-language/compare/v2.1.9...v2.1.10) (2022-03-29) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#825](https://github.com/googleapis/java-language/issues/825)) ([05fcd72](https://github.com/googleapis/java-language/commit/05fcd72c5a789207ce0afa60addef5db96924837)) - -### [2.1.9](https://github.com/googleapis/java-language/compare/v2.1.8...v2.1.9) (2022-03-02) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#815](https://github.com/googleapis/java-language/issues/815)) ([e2d7bf2](https://github.com/googleapis/java-language/commit/e2d7bf2e9019b5dcbb6c46b4251a66167be50482)) - -### [2.1.8](https://github.com/googleapis/java-language/compare/v2.1.7...v2.1.8) (2022-02-28) - - -### Dependencies - -* update actions/setup-java action to v3 ([#808](https://github.com/googleapis/java-language/issues/808)) ([d0bdffc](https://github.com/googleapis/java-language/commit/d0bdffc7da94c916beb12888569c510f5ed816da)) - -### [2.1.7](https://github.com/googleapis/java-language/compare/v2.1.6...v2.1.7) (2022-02-11) - - -### Dependencies - -* update actions/github-script action to v6 ([#800](https://github.com/googleapis/java-language/issues/800)) ([62ed30a](https://github.com/googleapis/java-language/commit/62ed30ac0d53c2da8df57333e5fccd515556e5da)) - -### [2.1.6](https://github.com/googleapis/java-language/compare/v2.1.5...v2.1.6) (2022-02-03) - - -### Dependencies - -* **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-language/issues/1339)) ([#788](https://github.com/googleapis/java-language/issues/788)) ([7eed3fd](https://github.com/googleapis/java-language/commit/7eed3fd1c23001bb091a6c530920d1643bfcedf2)) -* update actions/github-script action to v5 ([#787](https://github.com/googleapis/java-language/issues/787)) ([05adfaf](https://github.com/googleapis/java-language/commit/05adfaf82d26cf59a494c35b355fcb5aa23ec273)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#790](https://github.com/googleapis/java-language/issues/790)) ([56a7351](https://github.com/googleapis/java-language/commit/56a735107b28b3f5579585e4957312b167961ee3)) - -### [2.1.5](https://www.github.com/googleapis/java-language/compare/v2.1.4...v2.1.5) (2022-01-07) - - -### Bug Fixes - -* **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/java-language/issues/1299)) ([#764](https://www.github.com/googleapis/java-language/issues/764)) ([43a006a](https://www.github.com/googleapis/java-language/commit/43a006a2a77c25a16e9d4034bc155bb5773257fb)) -* **java:** run Maven in plain console-friendly mode ([#1301](https://www.github.com/googleapis/java-language/issues/1301)) ([#770](https://www.github.com/googleapis/java-language/issues/770)) ([e4cd369](https://www.github.com/googleapis/java-language/commit/e4cd369220848f7d0bfd9c1be96c975237b54869)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#774](https://www.github.com/googleapis/java-language/issues/774)) ([f77f6f7](https://www.github.com/googleapis/java-language/commit/f77f6f79cd88b038b5cfed34f2f243bd37bbe5fb)) - -### [2.1.4](https://www.github.com/googleapis/java-language/compare/v2.1.3...v2.1.4) (2021-12-03) - - -### Bug Fixes - -* **java:** java 17 dependency arguments ([#1266](https://www.github.com/googleapis/java-language/issues/1266)) ([#742](https://www.github.com/googleapis/java-language/issues/742)) ([48defbf](https://www.github.com/googleapis/java-language/commit/48defbf121efb9a8075cd64051bc7c93f21de8de)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#752](https://www.github.com/googleapis/java-language/issues/752)) ([3b5753c](https://www.github.com/googleapis/java-language/commit/3b5753c76dad7ee1199a304bfd76e118b31ec2a8)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#760](https://www.github.com/googleapis/java-language/issues/760)) ([14a9f32](https://www.github.com/googleapis/java-language/commit/14a9f326e88cdc599366aef1a53eee49ba55d1b9)) - -### [2.1.3](https://www.github.com/googleapis/java-language/compare/v2.1.2...v2.1.3) (2021-10-20) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#737](https://www.github.com/googleapis/java-language/issues/737)) ([4184de2](https://www.github.com/googleapis/java-language/commit/4184de2d60612727c14bc0c586b8ea89f94394ed)) - -### [2.1.2](https://www.github.com/googleapis/java-language/compare/v2.1.1...v2.1.2) (2021-09-22) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#723](https://www.github.com/googleapis/java-language/issues/723)) ([b245fe1](https://www.github.com/googleapis/java-language/commit/b245fe10f6ca80519354e0c0064c9b298cb6dd02)) - -### [2.1.1](https://www.github.com/googleapis/java-language/compare/v2.1.0...v2.1.1) (2021-09-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#716](https://www.github.com/googleapis/java-language/issues/716)) ([6139969](https://www.github.com/googleapis/java-language/commit/6139969b61e53ac5bfcf026c58a011b90124a783)) - -## [2.1.0](https://www.github.com/googleapis/java-language/compare/v2.0.2...v2.1.0) (2021-09-01) - - -### Features - -* Remove use of deprecated gradle command in java README ([#1196](https://www.github.com/googleapis/java-language/issues/1196)) ([#699](https://www.github.com/googleapis/java-language/issues/699)) ([cfd2179](https://www.github.com/googleapis/java-language/commit/cfd2179e4e835f4a372ed73fd174a4b7e7edbb5e)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#702](https://www.github.com/googleapis/java-language/issues/702)) ([ef02aeb](https://www.github.com/googleapis/java-language/commit/ef02aebfad0e6607d4d0d37ca4d129e4bd783916)) - -### [2.0.2](https://www.github.com/googleapis/java-language/compare/v2.0.1...v2.0.2) (2021-08-23) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#691](https://www.github.com/googleapis/java-language/issues/691)) ([f4787e4](https://www.github.com/googleapis/java-language/commit/f4787e43dec654601637676bbc0968eb4cdf42f9)) - -### [2.0.1](https://www.github.com/googleapis/java-language/compare/v2.0.0...v2.0.1) (2021-08-12) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#683](https://www.github.com/googleapis/java-language/issues/683)) ([9f4a254](https://www.github.com/googleapis/java-language/commit/9f4a254d64220e474da63978d6305f037db976db)) - -## [2.0.0](https://www.github.com/googleapis/java-language/compare/v1.103.2...v2.0.0) (2021-08-06) - - -### ⚠ BREAKING CHANGES - -* release gapic-generator-java v2.0.0 (#677) - -### Features - -* release gapic-generator-java v2.0.0 ([#677](https://www.github.com/googleapis/java-language/issues/677)) ([ec809de](https://www.github.com/googleapis/java-language/commit/ec809dedb6f7d1f51962377dad62f5a7e308853d)) - - -### Bug Fixes - -* owlbot post-processor should generate README ([#1154](https://www.github.com/googleapis/java-language/issues/1154)) ([#504](https://www.github.com/googleapis/java-language/issues/504)) ([e8e6d53](https://www.github.com/googleapis/java-language/commit/e8e6d5324196c75ac7e287798bca54e57184fbf4)), closes [#1146](https://www.github.com/googleapis/java-language/issues/1146) [#1147](https://www.github.com/googleapis/java-language/issues/1147) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#678](https://www.github.com/googleapis/java-language/issues/678)) ([62fe547](https://www.github.com/googleapis/java-language/commit/62fe547537c72cad19a2e79611d97c320ca32258)) - -### [1.103.2](https://www.github.com/googleapis/java-language/compare/v1.103.1...v1.103.2) (2021-07-01) - - -### Bug Fixes - -* Add `shopt -s nullglob` to dependencies script ([#1130](https://www.github.com/googleapis/java-language/issues/1130)) ([#490](https://www.github.com/googleapis/java-language/issues/490)) ([d6525dc](https://www.github.com/googleapis/java-language/commit/d6525dca8e2e5d6ea48580a4d6a9389560e4937f)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#494](https://www.github.com/googleapis/java-language/issues/494)) ([73d0c8e](https://www.github.com/googleapis/java-language/commit/73d0c8ece375ce1ff09ced579652a8f13331f001)) - -### [1.103.1](https://www.github.com/googleapis/java-language/compare/v1.103.0...v1.103.1) (2021-06-04) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#477](https://www.github.com/googleapis/java-language/issues/477)) ([463629d](https://www.github.com/googleapis/java-language/commit/463629db48b20fbc489f961408a159ce55d36d89)) - -## [1.103.0](https://www.github.com/googleapis/java-language/compare/v1.102.3...v1.103.0) (2021-05-26) - - -### Features - -* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#464](https://www.github.com/googleapis/java-language/issues/464)) ([894ed25](https://www.github.com/googleapis/java-language/commit/894ed25f36aee0a6f43f80a1c668b12eac169937)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#463](https://www.github.com/googleapis/java-language/issues/463)) ([5bbfa0b](https://www.github.com/googleapis/java-language/commit/5bbfa0b5fb6fe6b0a988e8d8a1827702cec548d2)) - -### [1.102.3](https://www.github.com/googleapis/java-language/compare/v1.102.2...v1.102.3) (2021-05-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#453](https://www.github.com/googleapis/java-language/issues/453)) ([8a0ddf2](https://www.github.com/googleapis/java-language/commit/8a0ddf25027a6fd98a968bfc1348de3fdb8e3ab0)) - -### [1.102.2](https://www.github.com/googleapis/java-language/compare/v1.102.1...v1.102.2) (2021-04-23) - - -### Bug Fixes - -* release scripts from issuing overlapping phases ([#435](https://www.github.com/googleapis/java-language/issues/435)) ([bd56c26](https://www.github.com/googleapis/java-language/commit/bd56c26dfd0013a961a0d19b049c16760dd74247)) -* typo ([#432](https://www.github.com/googleapis/java-language/issues/432)) ([64d69c8](https://www.github.com/googleapis/java-language/commit/64d69c879dc6be2c56aff5c01ede91ca5680a466)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#438](https://www.github.com/googleapis/java-language/issues/438)) ([f556fd2](https://www.github.com/googleapis/java-language/commit/f556fd29bc69008713fc5f5e5a6f0a9117d3eeb4)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#441](https://www.github.com/googleapis/java-language/issues/441)) ([5a769e1](https://www.github.com/googleapis/java-language/commit/5a769e1069d4b9444651257fce89a76c2b96aa57)) - -### [1.102.1](https://www.github.com/googleapis/java-language/compare/v1.102.0...v1.102.1) (2021-04-09) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#421](https://www.github.com/googleapis/java-language/issues/421)) ([25bef3a](https://www.github.com/googleapis/java-language/commit/25bef3aeacab187acf36352c660b00bbdf001c39)) - -## [1.102.0](https://www.github.com/googleapis/java-language/compare/v1.101.12...v1.102.0) (2021-03-11) - - -### Features - -* **generator:** update protoc to v3.15.3 ([#394](https://www.github.com/googleapis/java-language/issues/394)) ([061720a](https://www.github.com/googleapis/java-language/commit/061720a0be1ebfce1bffcbdefcabeb86d3f98f3b)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#405](https://www.github.com/googleapis/java-language/issues/405)) ([d68d427](https://www.github.com/googleapis/java-language/commit/d68d42752848657dd14b30efaa5efa81b8ad71a2)) - -### [1.101.12](https://www.github.com/googleapis/java-language/compare/v1.101.11...v1.101.12) (2021-02-25) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#389](https://www.github.com/googleapis/java-language/issues/389)) ([0a1535e](https://www.github.com/googleapis/java-language/commit/0a1535e8f2b18514c3a51147dd3fcd6dda37eb1f)) - -### [1.101.11](https://www.github.com/googleapis/java-language/compare/v1.101.10...v1.101.11) (2021-02-22) - - -### Documentation - -* generate sample code in the Java microgenerator ([#368](https://www.github.com/googleapis/java-language/issues/368)) ([85e966a](https://www.github.com/googleapis/java-language/commit/85e966a9a65aedde5b93173993cd06c94cf629aa)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#380](https://www.github.com/googleapis/java-language/issues/380)) ([55d4321](https://www.github.com/googleapis/java-language/commit/55d4321a5a10959eb3caf0f4fa9800ffb9fca2c9)) - -### [1.101.10](https://www.github.com/googleapis/java-language/compare/v1.101.9...v1.101.10) (2021-01-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.18.0 ([#349](https://www.github.com/googleapis/java-language/issues/349)) ([04c8c63](https://www.github.com/googleapis/java-language/commit/04c8c633850eca8e9d6b94e37d918c0953b7e380)) - -### [1.101.9](https://www.github.com/googleapis/java-language/compare/v1.101.8...v1.101.9) (2020-12-15) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#334](https://www.github.com/googleapis/java-language/issues/334)) ([929d783](https://www.github.com/googleapis/java-language/commit/929d7832dc80f1a16e980b12e111b43e0516ff3d)) - -### [1.101.8](https://www.github.com/googleapis/java-language/compare/v1.101.7...v1.101.8) (2020-12-14) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([#329](https://www.github.com/googleapis/java-language/issues/329)) ([96383fe](https://www.github.com/googleapis/java-language/commit/96383fe2f3adb4aef1f420eaec325c6e52c5f3cf)) - -### [1.101.7](https://www.github.com/googleapis/java-language/compare/v1.101.6...v1.101.7) (2020-12-02) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#321](https://www.github.com/googleapis/java-language/issues/321)) ([52f43f5](https://www.github.com/googleapis/java-language/commit/52f43f502f81bacb1583f83e4cca828af6e17dc7)) - -### [1.101.6](https://www.github.com/googleapis/java-language/compare/v1.101.5...v1.101.6) (2020-11-11) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.15.0 ([#304](https://www.github.com/googleapis/java-language/issues/304)) ([493b37d](https://www.github.com/googleapis/java-language/commit/493b37d8c1c304e6e519cf98c3fa67ad4aa22e68)) - -### [1.101.5](https://www.github.com/googleapis/java-language/compare/v1.101.4...v1.101.5) (2020-11-04) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.14.1 ([#290](https://www.github.com/googleapis/java-language/issues/290)) ([f004c40](https://www.github.com/googleapis/java-language/commit/f004c40946e2e49f1d8eeb68799b3ffc436e0a9c)) - -### [1.101.4](https://www.github.com/googleapis/java-language/compare/v1.101.3...v1.101.4) (2020-10-22) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.12.1 ([#266](https://www.github.com/googleapis/java-language/issues/266)) ([2a7b20e](https://www.github.com/googleapis/java-language/commit/2a7b20e59e6510834db33964b534391c3183abf5)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.13.0 ([#271](https://www.github.com/googleapis/java-language/issues/271)) ([94a2d98](https://www.github.com/googleapis/java-language/commit/94a2d987ce82a5cc4552522c96011e52b52a13bf)) - -### [1.101.3](https://www.github.com/googleapis/java-language/compare/v1.101.2...v1.101.3) (2020-10-08) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.2 ([#248](https://www.github.com/googleapis/java-language/issues/248)) ([93408a1](https://www.github.com/googleapis/java-language/commit/93408a12db405460936f71bf71493d5df7386336)) - - -### Documentation - -* fix proto comments for language API inorder for docs parsing to work correctly ([#251](https://www.github.com/googleapis/java-language/issues/251)) ([de34d73](https://www.github.com/googleapis/java-language/commit/de34d7324d40cc90d3eea34300105d849f4922a4)) - -### [1.101.2](https://www.github.com/googleapis/java-language/compare/v1.101.1...v1.101.2) (2020-09-23) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.0 ([#233](https://www.github.com/googleapis/java-language/issues/233)) ([25b5327](https://www.github.com/googleapis/java-language/commit/25b5327f12791e554d1d723cd543e19e67b0b8e2)) - -### [1.101.1](https://www.github.com/googleapis/java-language/compare/v1.101.0...v1.101.1) (2020-09-22) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.9.0 ([#215](https://www.github.com/googleapis/java-language/issues/215)) ([687fdd6](https://www.github.com/googleapis/java-language/commit/687fdd6c90be3e8233c74fe40d9ae0b35f22495c)) - -## [1.101.0](https://www.github.com/googleapis/java-language/compare/v1.100.0...v1.101.0) (2020-08-07) - - -### Features - -* **deps:** adopt flatten plugin and google-cloud-shared-dependencies ([#176](https://www.github.com/googleapis/java-language/issues/176)) ([da9046c](https://www.github.com/googleapis/java-language/commit/da9046c2feaa90268761ba15e9b900ee183e2e3e)) - - -### Bug Fixes - -* migrate to grpc_service_config ([#188](https://www.github.com/googleapis/java-language/issues/188)) ([3d1762d](https://www.github.com/googleapis/java-language/commit/3d1762d33fc2d18d79c4f238b62fc44954fab39e)) - - -### Dependencies - -* update dependency com.google.api:api-common to v1.9.1 ([#150](https://www.github.com/googleapis/java-language/issues/150)) ([6d241fa](https://www.github.com/googleapis/java-language/commit/6d241fadb64cc5def074042ae80fc93042066463)) -* update dependency com.google.api:api-common to v1.9.2 ([#157](https://www.github.com/googleapis/java-language/issues/157)) ([83bf00b](https://www.github.com/googleapis/java-language/commit/83bf00b3217acff6ac7cc6d309a0c006c906d27a)) -* update dependency com.google.api.grpc:proto-google-common-protos to v1.18.0 ([#139](https://www.github.com/googleapis/java-language/issues/139)) ([d1b8516](https://www.github.com/googleapis/java-language/commit/d1b8516a1229ecc0807144b69dc9fe9e48b63c78)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.2 ([#189](https://www.github.com/googleapis/java-language/issues/189)) ([34c2867](https://www.github.com/googleapis/java-language/commit/34c2867a19c29f59f89e8205a8c6ebdcfbbf8285)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.3 ([#191](https://www.github.com/googleapis/java-language/issues/191)) ([ab13ac1](https://www.github.com/googleapis/java-language/commit/ab13ac15c46bed94902d176fc0a4d1264aea4e7e)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.6 ([#199](https://www.github.com/googleapis/java-language/issues/199)) ([9608a5b](https://www.github.com/googleapis/java-language/commit/9608a5be225fcebf138bb820c049c555aaea195d)) -* update dependency com.google.protobuf:protobuf-java to v3.12.0 ([#143](https://www.github.com/googleapis/java-language/issues/143)) ([9cc04fa](https://www.github.com/googleapis/java-language/commit/9cc04fa0e3be5864757f549f8c65b203c985ab34)) -* update dependency com.google.protobuf:protobuf-java to v3.12.2 ([#148](https://www.github.com/googleapis/java-language/issues/148)) ([69a8524](https://www.github.com/googleapis/java-language/commit/69a85247c7f521e94d2f9c3a75e8dc2fb7ae2f42)) -* update dependency io.grpc:grpc-bom to v1.29.0 ([#129](https://www.github.com/googleapis/java-language/issues/129)) ([d24999c](https://www.github.com/googleapis/java-language/commit/d24999c81bcfb95ceeeb6dc1a92afc577838ef23)) -* update dependency io.grpc:grpc-bom to v1.30.0 ([#161](https://www.github.com/googleapis/java-language/issues/161)) ([09240a3](https://www.github.com/googleapis/java-language/commit/09240a31bb6f5e1d6ae597521ebab080c68ac896)) -* update dependency org.threeten:threetenbp to v1.4.4 ([#135](https://www.github.com/googleapis/java-language/issues/135)) ([a4fdbc3](https://www.github.com/googleapis/java-language/commit/a4fdbc3265a02669fc1cd2494bb8fcbf5ca81bdd)) - -## [1.100.0](https://www.github.com/googleapis/java-language/compare/v1.99.4...v1.100.0) (2020-04-20) - - -### Features - -* add method overloads for Document+EncodingType for analyze methods ([#120](https://www.github.com/googleapis/java-language/issues/120)) ([60ef073](https://www.github.com/googleapis/java-language/commit/60ef07316809ba0deb03bf16b56f58e522874c09)) - - -### Dependencies - -* update dependency com.google.guava:guava-bom to v29 ([#107](https://www.github.com/googleapis/java-language/issues/107)) ([587f83b](https://www.github.com/googleapis/java-language/commit/587f83b52db60ced3854748a17def39524c1d346)) - -### [1.99.4](https://www.github.com/googleapis/java-language/compare/v1.99.3...v1.99.4) (2020-04-09) - - -### Documentation - -* change relative URLs to absolute URLs to fix broken links ([#100](https://www.github.com/googleapis/java-language/issues/100)) ([32e8447](https://www.github.com/googleapis/java-language/commit/32e8447e9d37a44f58204decf5dcdc0684786651)) - - -### Dependencies - -* update core dependencies ([#75](https://www.github.com/googleapis/java-language/issues/75)) ([480275f](https://www.github.com/googleapis/java-language/commit/480275fbaf5f97dc28ddaaa489d038cf7f0328cb)) -* update dependency com.google.api:api-common to v1.9.0 ([#94](https://www.github.com/googleapis/java-language/issues/94)) ([dc4a66f](https://www.github.com/googleapis/java-language/commit/dc4a66f0cc2b1af2760126269fdbb4c6ec776aa2)) -* update dependency org.threeten:threetenbp to v1.4.3 ([#84](https://www.github.com/googleapis/java-language/issues/84)) ([576eb7c](https://www.github.com/googleapis/java-language/commit/576eb7c7e43fe70ae129fa1a40eee22b59181c6b)) - -### [1.99.3](https://www.github.com/googleapis/java-language/compare/v1.99.2...v1.99.3) (2020-03-10) - - -### Dependencies - -* update core dependencies to v1.54.0 ([#68](https://www.github.com/googleapis/java-language/issues/68)) ([83bfbb0](https://www.github.com/googleapis/java-language/commit/83bfbb052520ffd0fa3c7f939ee069b062de993d)) -* update dependency com.google.protobuf:protobuf-java to v3.11.4 ([37b8732](https://www.github.com/googleapis/java-language/commit/37b87329ba932bb3134ebf4ad96c79eab2a88265)) -* update dependency io.grpc:grpc-bom to v1.27.1 ([4a30ea4](https://www.github.com/googleapis/java-language/commit/4a30ea4e3d93007f26a51b3986a5215d2f6855a5)) -* update dependency io.grpc:grpc-bom to v1.27.2 ([0a7eaa6](https://www.github.com/googleapis/java-language/commit/0a7eaa6019cfcf368dcc939d969ce622a01cd5cd)) -* update java-core ([#69](https://www.github.com/googleapis/java-language/issues/69)) ([ecc1822](https://www.github.com/googleapis/java-language/commit/ecc18229fd4229db26895740fc5f046fcd09605c)) - - -### Documentation - -* **regen:** update sample code to set total timeout, add API client header test ([4f9cc95](https://www.github.com/googleapis/java-language/commit/4f9cc95c1148920987d1f52bdc0207f08ec05a33)) - -### [1.99.2](https://www.github.com/googleapis/java-language/compare/v1.99.1...v1.99.2) (2020-02-04) - - -### Dependencies - -* update core dependencies to v1.53.0 ([#42](https://www.github.com/googleapis/java-language/issues/42)) ([1a19705](https://www.github.com/googleapis/java-language/commit/1a1970550f50d07af46be754fa717e050f450a70)) -* update core dependencies to v1.53.1 ([#52](https://www.github.com/googleapis/java-language/issues/52)) ([66ba508](https://www.github.com/googleapis/java-language/commit/66ba5080f716cdf8ae8cd3a1d35378d0a4cb0ac4)) -* update dependency com.google.guava:guava-bom to v28.2-android ([#32](https://www.github.com/googleapis/java-language/issues/32)) ([6430c77](https://www.github.com/googleapis/java-language/commit/6430c776ff9a1a7d463d0f35ebea529d00ec9101)) -* update dependency com.google.protobuf:protobuf-java to v3.11.3 ([#54](https://www.github.com/googleapis/java-language/issues/54)) ([1cd82ee](https://www.github.com/googleapis/java-language/commit/1cd82eee92cab3c7deda49591a303282dee737a7)) -* update dependency io.grpc:grpc-bom to v1.27.0 ([#50](https://www.github.com/googleapis/java-language/issues/50)) ([8519b4e](https://www.github.com/googleapis/java-language/commit/8519b4ef73b6335cdb06185f9a34e38ade7a670b)) -* update dependency org.threeten:threetenbp to v1.4.1 ([b042fcb](https://www.github.com/googleapis/java-language/commit/b042fcb563039c005babb677b189f2718153ad36)) - -### [1.99.1](https://www.github.com/googleapis/java-language/compare/v1.99.0...v1.99.1) (2020-01-07) - - -### Dependencies - -* update dependency com.google.protobuf:protobuf-java to v3.11.1 ([#24](https://www.github.com/googleapis/java-language/issues/24)) ([fd68b4e](https://www.github.com/googleapis/java-language/commit/fd68b4e101b8b530696a88cdd065a22207b639bb)) -* update dependency io.grpc:grpc-bom to v1.26.0 ([#25](https://www.github.com/googleapis/java-language/issues/25)) ([5c27457](https://www.github.com/googleapis/java-language/commit/5c27457fe0a7822ed64ee7f46d7a713ae8b98c22)) -* update gax.version to v1.52.0 ([#20](https://www.github.com/googleapis/java-language/issues/20)) ([aa6c548](https://www.github.com/googleapis/java-language/commit/aa6c5480610847515e56b311ea089924f5172d67)) - - -### Documentation - -* reference libraries-bom in docs ([#11](https://www.github.com/googleapis/java-language/issues/11)) ([a0ee87f](https://www.github.com/googleapis/java-language/commit/a0ee87f8fbb2e84fee0801a9de8598e5f19e860b)) -* **regen:** update generated javadoc ([#21](https://www.github.com/googleapis/java-language/issues/21)) ([da12b27](https://www.github.com/googleapis/java-language/commit/da12b27fa60eb3571c9eb62d7ee9361f984f23a8)) -* **regen:** update javadocs from protoc update ([#26](https://www.github.com/googleapis/java-language/issues/26)) ([08b3366](https://www.github.com/googleapis/java-language/commit/08b3366f073f0fdaf16d5d69dd0e54692bbb62f9)) - -## [1.99.0](https://www.github.com/googleapis/java-language/compare/1.98.0...v1.99.0) (2019-10-30) - - -### Features - -* make repo releasable, add parent/bom ([#1](https://www.github.com/googleapis/java-language/issues/1)) ([1c7cfa5](https://www.github.com/googleapis/java-language/commit/1c7cfa5a37d90b38128ea6114beb730c96f80655)) - - -### Dependencies - -* update dependency io.grpc:grpc-bom to v1.24.1 ([#3](https://www.github.com/googleapis/java-language/issues/3)) ([2ff2998](https://www.github.com/googleapis/java-language/commit/2ff2998a685f23ef8ec3c3d6d55b666ff0b52396)) -* update gax.version to v1.49.1 ([#5](https://www.github.com/googleapis/java-language/issues/5)) ([3adf4da](https://www.github.com/googleapis/java-language/commit/3adf4da661cdf0141bcb0276a7e2be2ac721ece9)) diff --git a/codecov.yaml b/codecov.yaml deleted file mode 100644 index 5724ea94..00000000 --- a/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/google-cloud-language-bom/pom.xml b/google-cloud-language-bom/pom.xml deleted file mode 100644 index 44e6ce47..00000000 --- a/google-cloud-language-bom/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-language-bom - 2.4.2-SNAPSHOT - pom - - com.google.cloud - google-cloud-shared-config - 1.5.4 - - - Google Cloud language BOM - https://github.com/googleapis/java-language - - BOM for Google Cloud Natural Language - - - - Google LLC - - - - - chingor13 - Jeff Ching - chingor@google.com - Google LLC - - Developer - - - - - - scm:git:https://github.com/googleapis/java-language.git - scm:git:git@github.com:googleapis/java-language.git - https://github.com/googleapis/java-language - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - - com.google.cloud - google-cloud-language - 2.4.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-language-v1 - 2.4.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-language-v1beta2 - 0.91.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-language-v1 - 2.4.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-language-v1beta2 - 0.91.2-SNAPSHOT - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - true - - - - - diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml deleted file mode 100644 index da555089..00000000 --- a/google-cloud-language/pom.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-language - 2.4.2-SNAPSHOT - jar - Google Cloud Natural Language - https://github.com/googleapis/java-language - Java idiomatic client for Google Clould Natural Language - - com.google.cloud - google-cloud-language-parent - 2.4.2-SNAPSHOT - - - google-cloud-language - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.api - api-common - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-common-protos - - - - com.google.api.grpc - proto-google-cloud-language-v1 - - - com.google.api.grpc - proto-google-cloud-language-v1beta2 - - - com.google.guava - guava - - - com.google.api - gax - - - com.google.api - gax-grpc - - - com.google.api - gax-httpjson - - - org.threeten - threetenbp - - - - - junit - junit - test - - - - com.google.api.grpc - grpc-google-cloud-language-v1 - test - - - com.google.api.grpc - grpc-google-cloud-language-v1beta2 - test - - - - com.google.api - gax - testlib - test - - - com.google.api - gax-grpc - testlib - test - - - com.google.api - gax-httpjson - testlib - test - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java deleted file mode 100644 index dd726dd4..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java +++ /dev/null @@ -1,910 +0,0 @@ -/* - * Copyright 2022 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.language.v1; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.language.v1.stub.LanguageServiceStub; -import com.google.cloud.language.v1.stub.LanguageServiceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Provides text analysis operations such as sentiment analysis and entity - * recognition. - * - *

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: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
- *   Document document = Document.newBuilder().build();
- *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
- * }
- * }
- * - *

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

To customize credentials: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings languageServiceSettings =
- *     LanguageServiceSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * LanguageServiceClient languageServiceClient =
- *     LanguageServiceClient.create(languageServiceSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings languageServiceSettings =
- *     LanguageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * LanguageServiceClient languageServiceClient =
- *     LanguageServiceClient.create(languageServiceSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings languageServiceSettings =
- *     LanguageServiceSettings.newHttpJsonBuilder().build();
- * LanguageServiceClient languageServiceClient =
- *     LanguageServiceClient.create(languageServiceSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class LanguageServiceClient implements BackgroundResource { - private final LanguageServiceSettings settings; - private final LanguageServiceStub stub; - - /** Constructs an instance of LanguageServiceClient with default settings. */ - public static final LanguageServiceClient create() throws IOException { - return create(LanguageServiceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of LanguageServiceClient, 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 LanguageServiceClient create(LanguageServiceSettings settings) - throws IOException { - return new LanguageServiceClient(settings); - } - - /** - * Constructs an instance of LanguageServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer using create(LanguageServiceSettings). - */ - public static final LanguageServiceClient create(LanguageServiceStub stub) { - return new LanguageServiceClient(stub); - } - - /** - * Constructs an instance of LanguageServiceClient, 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 LanguageServiceClient(LanguageServiceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((LanguageServiceStubSettings) settings.getStubSettings()).createStub(); - } - - protected LanguageServiceClient(LanguageServiceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final LanguageServiceSettings getSettings() { - return settings; - } - - public LanguageServiceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSentimentResponse analyzeSentiment(Document document) { - AnalyzeSentimentRequest request = - AnalyzeSentimentRequest.newBuilder().setDocument(document).build(); - return analyzeSentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeSentimentResponse response =
-   *       languageServiceClient.analyzeSentiment(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate sentence offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSentimentResponse analyzeSentiment( - Document document, EncodingType encodingType) { - AnalyzeSentimentRequest request = - AnalyzeSentimentRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeSentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSentimentRequest request =
-   *       AnalyzeSentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(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 AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest request) { - return analyzeSentimentCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSentimentRequest request =
-   *       AnalyzeSentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeSentimentCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeSentimentResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - analyzeSentimentCallable() { - return stub.analyzeSentimentCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitiesResponse analyzeEntities(Document document) { - AnalyzeEntitiesRequest request = - AnalyzeEntitiesRequest.newBuilder().setDocument(document).build(); - return analyzeEntities(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeEntitiesResponse response =
-   *       languageServiceClient.analyzeEntities(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitiesResponse analyzeEntities( - Document document, EncodingType encodingType) { - AnalyzeEntitiesRequest request = - AnalyzeEntitiesRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeEntities(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitiesRequest request =
-   *       AnalyzeEntitiesRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(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 AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest request) { - return analyzeEntitiesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitiesRequest request =
-   *       AnalyzeEntitiesRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeEntitiesCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeEntitiesResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - analyzeEntitiesCallable() { - return stub.analyzeEntitiesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and - * analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeEntitySentimentResponse response =
-   *       languageServiceClient.analyzeEntitySentiment(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) { - AnalyzeEntitySentimentRequest request = - AnalyzeEntitySentimentRequest.newBuilder().setDocument(document).build(); - return analyzeEntitySentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and - * analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeEntitySentimentResponse response =
-   *       languageServiceClient.analyzeEntitySentiment(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( - Document document, EncodingType encodingType) { - AnalyzeEntitySentimentRequest request = - AnalyzeEntitySentimentRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeEntitySentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and - * analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitySentimentRequest request =
-   *       AnalyzeEntitySentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeEntitySentimentResponse response =
-   *       languageServiceClient.analyzeEntitySentiment(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 AnalyzeEntitySentimentResponse analyzeEntitySentiment( - AnalyzeEntitySentimentRequest request) { - return analyzeEntitySentimentCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and - * analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitySentimentRequest request =
-   *       AnalyzeEntitySentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeEntitySentimentCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeEntitySentimentResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - analyzeEntitySentimentCallable() { - return stub.analyzeEntitySentimentCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { - AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder().setDocument(document).build(); - return analyzeSyntax(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType encodingType) { - AnalyzeSyntaxRequest request = - AnalyzeSyntaxRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeSyntax(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSyntaxRequest request =
-   *       AnalyzeSyntaxRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(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 AnalyzeSyntaxResponse analyzeSyntax(AnalyzeSyntaxRequest request) { - return analyzeSyntaxCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSyntaxRequest request =
-   *       AnalyzeSyntaxRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeSyntaxCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeSyntaxResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable analyzeSyntaxCallable() { - return stub.analyzeSyntaxCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Classifies a document into categories. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   ClassifyTextResponse response = languageServiceClient.classifyText(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ClassifyTextResponse classifyText(Document document) { - ClassifyTextRequest request = ClassifyTextRequest.newBuilder().setDocument(document).build(); - return classifyText(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Classifies a document into categories. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   ClassifyTextRequest request =
-   *       ClassifyTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build())
-   *           .build();
-   *   ClassifyTextResponse response = languageServiceClient.classifyText(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 ClassifyTextResponse classifyText(ClassifyTextRequest request) { - return classifyTextCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Classifies a document into categories. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   ClassifyTextRequest request =
-   *       ClassifyTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.classifyTextCallable().futureCall(request);
-   *   // Do something.
-   *   ClassifyTextResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable classifyTextCallable() { - return stub.classifyTextCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and - * analyzeSyntax provide in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
-   *   AnnotateTextResponse response = languageServiceClient.annotateText(document, features);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param features Required. The enabled features. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnnotateTextResponse annotateText( - Document document, AnnotateTextRequest.Features features) { - AnnotateTextRequest request = - AnnotateTextRequest.newBuilder().setDocument(document).setFeatures(features).build(); - return annotateText(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and - * analyzeSyntax provide in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnnotateTextResponse response =
-   *       languageServiceClient.annotateText(document, features, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param features Required. The enabled features. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnnotateTextResponse annotateText( - Document document, AnnotateTextRequest.Features features, EncodingType encodingType) { - AnnotateTextRequest request = - AnnotateTextRequest.newBuilder() - .setDocument(document) - .setFeatures(features) - .setEncodingType(encodingType) - .build(); - return annotateText(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and - * analyzeSyntax provide in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnnotateTextRequest request =
-   *       AnnotateTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setFeatures(AnnotateTextRequest.Features.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnnotateTextResponse response = languageServiceClient.annotateText(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 AnnotateTextResponse annotateText(AnnotateTextRequest request) { - return annotateTextCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and - * analyzeSyntax provide in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnnotateTextRequest request =
-   *       AnnotateTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setFeatures(AnnotateTextRequest.Features.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.annotateTextCallable().futureCall(request);
-   *   // Do something.
-   *   AnnotateTextResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable annotateTextCallable() { - return stub.annotateTextCallable(); - } - - @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-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java deleted file mode 100644 index ddb085e7..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceSettings.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright 2022 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.language.v1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.language.v1.stub.LanguageServiceStubSettings; -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 LanguageServiceClient}. - * - *

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

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings.Builder languageServiceSettingsBuilder =
- *     LanguageServiceSettings.newBuilder();
- * languageServiceSettingsBuilder
- *     .analyzeSentimentSettings()
- *     .setRetrySettings(
- *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class LanguageServiceSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings - analyzeSentimentSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeSentimentSettings(); - } - - /** Returns the object with the settings used for calls to analyzeEntities. */ - public UnaryCallSettings - analyzeEntitiesSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeEntitiesSettings(); - } - - /** Returns the object with the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings - analyzeEntitySentimentSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeEntitySentimentSettings(); - } - - /** Returns the object with the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings analyzeSyntaxSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeSyntaxSettings(); - } - - /** Returns the object with the settings used for calls to classifyText. */ - public UnaryCallSettings classifyTextSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).classifyTextSettings(); - } - - /** Returns the object with the settings used for calls to annotateText. */ - public UnaryCallSettings annotateTextSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).annotateTextSettings(); - } - - public static final LanguageServiceSettings create(LanguageServiceStubSettings stub) - throws IOException { - return new LanguageServiceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return LanguageServiceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return LanguageServiceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return LanguageServiceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return LanguageServiceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return LanguageServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return LanguageServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return LanguageServiceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return LanguageServiceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 LanguageServiceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for LanguageServiceSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(LanguageServiceStubSettings.newBuilder(clientContext)); - } - - protected Builder(LanguageServiceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(LanguageServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(LanguageServiceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(LanguageServiceStubSettings.newHttpJsonBuilder()); - } - - public LanguageServiceStubSettings.Builder getStubSettingsBuilder() { - return ((LanguageServiceStubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings.Builder - analyzeSentimentSettings() { - return getStubSettingsBuilder().analyzeSentimentSettings(); - } - - /** Returns the builder for the settings used for calls to analyzeEntities. */ - public UnaryCallSettings.Builder - analyzeEntitiesSettings() { - return getStubSettingsBuilder().analyzeEntitiesSettings(); - } - - /** Returns the builder for the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings.Builder - analyzeEntitySentimentSettings() { - return getStubSettingsBuilder().analyzeEntitySentimentSettings(); - } - - /** Returns the builder for the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings.Builder - analyzeSyntaxSettings() { - return getStubSettingsBuilder().analyzeSyntaxSettings(); - } - - /** Returns the builder for the settings used for calls to classifyText. */ - public UnaryCallSettings.Builder - classifyTextSettings() { - return getStubSettingsBuilder().classifyTextSettings(); - } - - /** Returns the builder for the settings used for calls to annotateText. */ - public UnaryCallSettings.Builder - annotateTextSettings() { - return getStubSettingsBuilder().annotateTextSettings(); - } - - @Override - public LanguageServiceSettings build() throws IOException { - return new LanguageServiceSettings(this); - } - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/gapic_metadata.json b/google-cloud-language/src/main/java/com/google/cloud/language/v1/gapic_metadata.json deleted file mode 100644 index 46503565..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/gapic_metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.cloud.language.v1", - "libraryPackage": "com.google.cloud.language.v1", - "services": { - "LanguageService": { - "clients": { - "grpc": { - "libraryClient": "LanguageServiceClient", - "rpcs": { - "AnalyzeEntities": { - "methods": ["analyzeEntities", "analyzeEntities", "analyzeEntities", "analyzeEntitiesCallable"] - }, - "AnalyzeEntitySentiment": { - "methods": ["analyzeEntitySentiment", "analyzeEntitySentiment", "analyzeEntitySentiment", "analyzeEntitySentimentCallable"] - }, - "AnalyzeSentiment": { - "methods": ["analyzeSentiment", "analyzeSentiment", "analyzeSentiment", "analyzeSentimentCallable"] - }, - "AnalyzeSyntax": { - "methods": ["analyzeSyntax", "analyzeSyntax", "analyzeSyntax", "analyzeSyntaxCallable"] - }, - "AnnotateText": { - "methods": ["annotateText", "annotateText", "annotateText", "annotateTextCallable"] - }, - "ClassifyText": { - "methods": ["classifyText", "classifyText", "classifyTextCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java deleted file mode 100644 index a3260a78..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 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 Natural Language API - * - *

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

======================= LanguageServiceClient ======================= - * - *

Service Description: Provides text analysis operations such as sentiment analysis and entity - * recognition. - * - *

Sample for LanguageServiceClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
- *   Document document = Document.newBuilder().build();
- *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.cloud.language.v1; - -import javax.annotation.Generated; diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceCallableFactory.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceCallableFactory.java deleted file mode 100644 index 8fcd7a3b..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2022 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.language.v1.stub; - -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.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the LanguageService service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcLanguageServiceCallableFactory 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 callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceStub.java deleted file mode 100644 index 7283548c..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/GrpcLanguageServiceStub.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright 2022 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.language.v1.stub; - -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.UnaryCallable; -import com.google.cloud.language.v1.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1.AnalyzeSentimentRequest; -import com.google.cloud.language.v1.AnalyzeSentimentResponse; -import com.google.cloud.language.v1.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1.AnnotateTextRequest; -import com.google.cloud.language.v1.AnnotateTextResponse; -import com.google.cloud.language.v1.ClassifyTextRequest; -import com.google.cloud.language.v1.ClassifyTextResponse; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the LanguageService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcLanguageServiceStub extends LanguageServiceStub { - private static final MethodDescriptor - analyzeSentimentMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeSentiment") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeSentimentRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeSentimentResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - analyzeEntitiesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeEntities") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeEntitiesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeEntitiesResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor< - AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse> - analyzeEntitySentimentMethodDescriptor = - MethodDescriptor - .newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeEntitySentiment") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeEntitySentimentRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeEntitySentimentResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - analyzeSyntaxMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeSyntax") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeSyntaxRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeSyntaxResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - classifyTextMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1.LanguageService/ClassifyText") - .setRequestMarshaller(ProtoUtils.marshaller(ClassifyTextRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ClassifyTextResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - annotateTextMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1.LanguageService/AnnotateText") - .setRequestMarshaller(ProtoUtils.marshaller(AnnotateTextRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnnotateTextResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable - analyzeSentimentCallable; - private final UnaryCallable - analyzeEntitiesCallable; - private final UnaryCallable - analyzeEntitySentimentCallable; - private final UnaryCallable analyzeSyntaxCallable; - private final UnaryCallable classifyTextCallable; - private final UnaryCallable annotateTextCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcLanguageServiceStub create(LanguageServiceStubSettings settings) - throws IOException { - return new GrpcLanguageServiceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcLanguageServiceStub create(ClientContext clientContext) - throws IOException { - return new GrpcLanguageServiceStub( - LanguageServiceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcLanguageServiceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcLanguageServiceStub( - LanguageServiceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcLanguageServiceStub, 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 GrpcLanguageServiceStub( - LanguageServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcLanguageServiceCallableFactory()); - } - - /** - * Constructs an instance of GrpcLanguageServiceStub, 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 GrpcLanguageServiceStub( - LanguageServiceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings - analyzeSentimentTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeSentimentMethodDescriptor) - .build(); - GrpcCallSettings - analyzeEntitiesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeEntitiesMethodDescriptor) - .build(); - GrpcCallSettings - analyzeEntitySentimentTransportSettings = - GrpcCallSettings - .newBuilder() - .setMethodDescriptor(analyzeEntitySentimentMethodDescriptor) - .build(); - GrpcCallSettings analyzeSyntaxTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeSyntaxMethodDescriptor) - .build(); - GrpcCallSettings classifyTextTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(classifyTextMethodDescriptor) - .build(); - GrpcCallSettings annotateTextTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(annotateTextMethodDescriptor) - .build(); - - this.analyzeSentimentCallable = - callableFactory.createUnaryCallable( - analyzeSentimentTransportSettings, settings.analyzeSentimentSettings(), clientContext); - this.analyzeEntitiesCallable = - callableFactory.createUnaryCallable( - analyzeEntitiesTransportSettings, settings.analyzeEntitiesSettings(), clientContext); - this.analyzeEntitySentimentCallable = - callableFactory.createUnaryCallable( - analyzeEntitySentimentTransportSettings, - settings.analyzeEntitySentimentSettings(), - clientContext); - this.analyzeSyntaxCallable = - callableFactory.createUnaryCallable( - analyzeSyntaxTransportSettings, settings.analyzeSyntaxSettings(), clientContext); - this.classifyTextCallable = - callableFactory.createUnaryCallable( - classifyTextTransportSettings, settings.classifyTextSettings(), clientContext); - this.annotateTextCallable = - callableFactory.createUnaryCallable( - annotateTextTransportSettings, settings.annotateTextSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable - analyzeSentimentCallable() { - return analyzeSentimentCallable; - } - - @Override - public UnaryCallable analyzeEntitiesCallable() { - return analyzeEntitiesCallable; - } - - @Override - public UnaryCallable - analyzeEntitySentimentCallable() { - return analyzeEntitySentimentCallable; - } - - @Override - public UnaryCallable analyzeSyntaxCallable() { - return analyzeSyntaxCallable; - } - - @Override - public UnaryCallable classifyTextCallable() { - return classifyTextCallable; - } - - @Override - public UnaryCallable annotateTextCallable() { - return annotateTextCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceCallableFactory.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceCallableFactory.java deleted file mode 100644 index e6957779..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 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.language.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the LanguageService service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonLanguageServiceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java deleted file mode 100644 index 7956fe99..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/HttpJsonLanguageServiceStub.java +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Copyright 2022 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.language.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.language.v1.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1.AnalyzeSentimentRequest; -import com.google.cloud.language.v1.AnalyzeSentimentResponse; -import com.google.cloud.language.v1.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1.AnnotateTextRequest; -import com.google.cloud.language.v1.AnnotateTextResponse; -import com.google.cloud.language.v1.ClassifyTextRequest; -import com.google.cloud.language.v1.ClassifyTextResponse; -import com.google.protobuf.TypeRegistry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the LanguageService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonLanguageServiceStub extends LanguageServiceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - analyzeSentimentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeSentiment") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/documents:analyzeSentiment", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeSentimentResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - analyzeEntitiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeEntities") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/documents:analyzeEntities", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeEntitiesResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor< - AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse> - analyzeEntitySentimentMethodDescriptor = - ApiMethodDescriptor - .newBuilder() - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeEntitySentiment") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/documents:analyzeEntitySentiment", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeEntitySentimentResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - analyzeSyntaxMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1.LanguageService/AnalyzeSyntax") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/documents:analyzeSyntax", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeSyntaxResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - classifyTextMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1.LanguageService/ClassifyText") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/documents:classifyText", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ClassifyTextResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - annotateTextMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1.LanguageService/AnnotateText") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/documents:annotateText", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnnotateTextResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable - analyzeSentimentCallable; - private final UnaryCallable - analyzeEntitiesCallable; - private final UnaryCallable - analyzeEntitySentimentCallable; - private final UnaryCallable analyzeSyntaxCallable; - private final UnaryCallable classifyTextCallable; - private final UnaryCallable annotateTextCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonLanguageServiceStub create(LanguageServiceStubSettings settings) - throws IOException { - return new HttpJsonLanguageServiceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonLanguageServiceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonLanguageServiceStub( - LanguageServiceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonLanguageServiceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonLanguageServiceStub( - LanguageServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonLanguageServiceStub, 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 HttpJsonLanguageServiceStub( - LanguageServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new HttpJsonLanguageServiceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonLanguageServiceStub, 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 HttpJsonLanguageServiceStub( - LanguageServiceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings - analyzeSentimentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(analyzeSentimentMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - analyzeEntitiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(analyzeEntitiesMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - analyzeEntitySentimentTransportSettings = - HttpJsonCallSettings - .newBuilder() - .setMethodDescriptor(analyzeEntitySentimentMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - analyzeSyntaxTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(analyzeSyntaxMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings classifyTextTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(classifyTextMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings annotateTextTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(annotateTextMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.analyzeSentimentCallable = - callableFactory.createUnaryCallable( - analyzeSentimentTransportSettings, settings.analyzeSentimentSettings(), clientContext); - this.analyzeEntitiesCallable = - callableFactory.createUnaryCallable( - analyzeEntitiesTransportSettings, settings.analyzeEntitiesSettings(), clientContext); - this.analyzeEntitySentimentCallable = - callableFactory.createUnaryCallable( - analyzeEntitySentimentTransportSettings, - settings.analyzeEntitySentimentSettings(), - clientContext); - this.analyzeSyntaxCallable = - callableFactory.createUnaryCallable( - analyzeSyntaxTransportSettings, settings.analyzeSyntaxSettings(), clientContext); - this.classifyTextCallable = - callableFactory.createUnaryCallable( - classifyTextTransportSettings, settings.classifyTextSettings(), clientContext); - this.annotateTextCallable = - callableFactory.createUnaryCallable( - annotateTextTransportSettings, settings.annotateTextSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(analyzeSentimentMethodDescriptor); - methodDescriptors.add(analyzeEntitiesMethodDescriptor); - methodDescriptors.add(analyzeEntitySentimentMethodDescriptor); - methodDescriptors.add(analyzeSyntaxMethodDescriptor); - methodDescriptors.add(classifyTextMethodDescriptor); - methodDescriptors.add(annotateTextMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable - analyzeSentimentCallable() { - return analyzeSentimentCallable; - } - - @Override - public UnaryCallable analyzeEntitiesCallable() { - return analyzeEntitiesCallable; - } - - @Override - public UnaryCallable - analyzeEntitySentimentCallable() { - return analyzeEntitySentimentCallable; - } - - @Override - public UnaryCallable analyzeSyntaxCallable() { - return analyzeSyntaxCallable; - } - - @Override - public UnaryCallable classifyTextCallable() { - return classifyTextCallable; - } - - @Override - public UnaryCallable annotateTextCallable() { - return annotateTextCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStub.java deleted file mode 100644 index 89ea0036..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStub.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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.language.v1.stub; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.language.v1.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1.AnalyzeSentimentRequest; -import com.google.cloud.language.v1.AnalyzeSentimentResponse; -import com.google.cloud.language.v1.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1.AnnotateTextRequest; -import com.google.cloud.language.v1.AnnotateTextResponse; -import com.google.cloud.language.v1.ClassifyTextRequest; -import com.google.cloud.language.v1.ClassifyTextResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the LanguageService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class LanguageServiceStub implements BackgroundResource { - - public UnaryCallable - analyzeSentimentCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeSentimentCallable()"); - } - - public UnaryCallable analyzeEntitiesCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeEntitiesCallable()"); - } - - public UnaryCallable - analyzeEntitySentimentCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeEntitySentimentCallable()"); - } - - public UnaryCallable analyzeSyntaxCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeSyntaxCallable()"); - } - - public UnaryCallable classifyTextCallable() { - throw new UnsupportedOperationException("Not implemented: classifyTextCallable()"); - } - - public UnaryCallable annotateTextCallable() { - throw new UnsupportedOperationException("Not implemented: annotateTextCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java deleted file mode 100644 index 2b662592..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Copyright 2022 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.language.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.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.language.v1.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1.AnalyzeSentimentRequest; -import com.google.cloud.language.v1.AnalyzeSentimentResponse; -import com.google.cloud.language.v1.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1.AnnotateTextRequest; -import com.google.cloud.language.v1.AnnotateTextResponse; -import com.google.cloud.language.v1.ClassifyTextRequest; -import com.google.cloud.language.v1.ClassifyTextResponse; -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 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 LanguageServiceStub}. - * - *

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

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceStubSettings.Builder languageServiceSettingsBuilder =
- *     LanguageServiceStubSettings.newBuilder();
- * languageServiceSettingsBuilder
- *     .analyzeSentimentSettings()
- *     .setRetrySettings(
- *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class LanguageServiceStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-language") - .add("https://www.googleapis.com/auth/cloud-platform") - .build(); - - private final UnaryCallSettings - analyzeSentimentSettings; - private final UnaryCallSettings - analyzeEntitiesSettings; - private final UnaryCallSettings - analyzeEntitySentimentSettings; - private final UnaryCallSettings - analyzeSyntaxSettings; - private final UnaryCallSettings classifyTextSettings; - private final UnaryCallSettings annotateTextSettings; - - /** Returns the object with the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings - analyzeSentimentSettings() { - return analyzeSentimentSettings; - } - - /** Returns the object with the settings used for calls to analyzeEntities. */ - public UnaryCallSettings - analyzeEntitiesSettings() { - return analyzeEntitiesSettings; - } - - /** Returns the object with the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings - analyzeEntitySentimentSettings() { - return analyzeEntitySentimentSettings; - } - - /** Returns the object with the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings analyzeSyntaxSettings() { - return analyzeSyntaxSettings; - } - - /** Returns the object with the settings used for calls to classifyText. */ - public UnaryCallSettings classifyTextSettings() { - return classifyTextSettings; - } - - /** Returns the object with the settings used for calls to annotateText. */ - public UnaryCallSettings annotateTextSettings() { - return annotateTextSettings; - } - - public LanguageServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcLanguageServiceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonLanguageServiceStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", 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 "language.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "language.mtls.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) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - 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 defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(LanguageServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(LanguageServiceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return LanguageServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 LanguageServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - analyzeSentimentSettings = settingsBuilder.analyzeSentimentSettings().build(); - analyzeEntitiesSettings = settingsBuilder.analyzeEntitiesSettings().build(); - analyzeEntitySentimentSettings = settingsBuilder.analyzeEntitySentimentSettings().build(); - analyzeSyntaxSettings = settingsBuilder.analyzeSyntaxSettings().build(); - classifyTextSettings = settingsBuilder.classifyTextSettings().build(); - annotateTextSettings = settingsBuilder.annotateTextSettings().build(); - } - - /** Builder for LanguageServiceStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - analyzeSentimentSettings; - private final UnaryCallSettings.Builder - analyzeEntitiesSettings; - private final UnaryCallSettings.Builder< - AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse> - analyzeEntitySentimentSettings; - private final UnaryCallSettings.Builder - analyzeSyntaxSettings; - private final UnaryCallSettings.Builder - classifyTextSettings; - private final UnaryCallSettings.Builder - annotateTextSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - 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(600000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(600000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - analyzeSentimentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - analyzeEntitiesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - analyzeEntitySentimentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - analyzeSyntaxSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - classifyTextSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - annotateTextSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - analyzeSentimentSettings, - analyzeEntitiesSettings, - analyzeEntitySentimentSettings, - analyzeSyntaxSettings, - classifyTextSettings, - annotateTextSettings); - initDefaults(this); - } - - protected Builder(LanguageServiceStubSettings settings) { - super(settings); - - analyzeSentimentSettings = settings.analyzeSentimentSettings.toBuilder(); - analyzeEntitiesSettings = settings.analyzeEntitiesSettings.toBuilder(); - analyzeEntitySentimentSettings = settings.analyzeEntitySentimentSettings.toBuilder(); - analyzeSyntaxSettings = settings.analyzeSyntaxSettings.toBuilder(); - classifyTextSettings = settings.classifyTextSettings.toBuilder(); - annotateTextSettings = settings.annotateTextSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - analyzeSentimentSettings, - analyzeEntitiesSettings, - analyzeEntitySentimentSettings, - analyzeSyntaxSettings, - classifyTextSettings, - annotateTextSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .analyzeSentimentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .analyzeEntitiesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .analyzeEntitySentimentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .analyzeSyntaxSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .classifyTextSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .annotateTextSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - return builder; - } - - /** - * 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) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings.Builder - analyzeSentimentSettings() { - return analyzeSentimentSettings; - } - - /** Returns the builder for the settings used for calls to analyzeEntities. */ - public UnaryCallSettings.Builder - analyzeEntitiesSettings() { - return analyzeEntitiesSettings; - } - - /** Returns the builder for the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings.Builder - analyzeEntitySentimentSettings() { - return analyzeEntitySentimentSettings; - } - - /** Returns the builder for the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings.Builder - analyzeSyntaxSettings() { - return analyzeSyntaxSettings; - } - - /** Returns the builder for the settings used for calls to classifyText. */ - public UnaryCallSettings.Builder - classifyTextSettings() { - return classifyTextSettings; - } - - /** Returns the builder for the settings used for calls to annotateText. */ - public UnaryCallSettings.Builder - annotateTextSettings() { - return annotateTextSettings; - } - - @Override - public LanguageServiceStubSettings build() throws IOException { - return new LanguageServiceStubSettings(this); - } - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java deleted file mode 100644 index ca3318fc..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright 2022 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.language.v1beta2; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.language.v1beta2.stub.LanguageServiceStub; -import com.google.cloud.language.v1beta2.stub.LanguageServiceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Provides text analysis operations such as sentiment analysis and entity - * recognition. - * - *

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: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
- *   Document document = Document.newBuilder().build();
- *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
- * }
- * }
- * - *

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

To customize credentials: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings languageServiceSettings =
- *     LanguageServiceSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * LanguageServiceClient languageServiceClient =
- *     LanguageServiceClient.create(languageServiceSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings languageServiceSettings =
- *     LanguageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * LanguageServiceClient languageServiceClient =
- *     LanguageServiceClient.create(languageServiceSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings languageServiceSettings =
- *     LanguageServiceSettings.newHttpJsonBuilder().build();
- * LanguageServiceClient languageServiceClient =
- *     LanguageServiceClient.create(languageServiceSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class LanguageServiceClient implements BackgroundResource { - private final LanguageServiceSettings settings; - private final LanguageServiceStub stub; - - /** Constructs an instance of LanguageServiceClient with default settings. */ - public static final LanguageServiceClient create() throws IOException { - return create(LanguageServiceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of LanguageServiceClient, 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 LanguageServiceClient create(LanguageServiceSettings settings) - throws IOException { - return new LanguageServiceClient(settings); - } - - /** - * Constructs an instance of LanguageServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer using create(LanguageServiceSettings). - */ - public static final LanguageServiceClient create(LanguageServiceStub stub) { - return new LanguageServiceClient(stub); - } - - /** - * Constructs an instance of LanguageServiceClient, 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 LanguageServiceClient(LanguageServiceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((LanguageServiceStubSettings) settings.getStubSettings()).createStub(); - } - - protected LanguageServiceClient(LanguageServiceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final LanguageServiceSettings getSettings() { - return settings; - } - - public LanguageServiceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSentimentResponse analyzeSentiment(Document document) { - AnalyzeSentimentRequest request = - AnalyzeSentimentRequest.newBuilder().setDocument(document).build(); - return analyzeSentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeSentimentResponse response =
-   *       languageServiceClient.analyzeSentiment(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate sentence offsets for the - * sentence sentiment. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSentimentResponse analyzeSentiment( - Document document, EncodingType encodingType) { - AnalyzeSentimentRequest request = - AnalyzeSentimentRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeSentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSentimentRequest request =
-   *       AnalyzeSentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(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 AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest request) { - return analyzeSentimentCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the sentiment of the provided text. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSentimentRequest request =
-   *       AnalyzeSentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeSentimentCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeSentimentResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - analyzeSentimentCallable() { - return stub.analyzeSentimentCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitiesResponse analyzeEntities(Document document) { - AnalyzeEntitiesRequest request = - AnalyzeEntitiesRequest.newBuilder().setDocument(document).build(); - return analyzeEntities(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeEntitiesResponse response =
-   *       languageServiceClient.analyzeEntities(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitiesResponse analyzeEntities( - Document document, EncodingType encodingType) { - AnalyzeEntitiesRequest request = - AnalyzeEntitiesRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeEntities(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitiesRequest request =
-   *       AnalyzeEntitiesRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(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 AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest request) { - return analyzeEntitiesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds named entities (currently proper names and common nouns) in the text along with entity - * types, salience, mentions for each entity, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitiesRequest request =
-   *       AnalyzeEntitiesRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeEntitiesCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeEntitiesResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - analyzeEntitiesCallable() { - return stub.analyzeEntitiesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text - * and analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeEntitySentimentResponse response =
-   *       languageServiceClient.analyzeEntitySentiment(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) { - AnalyzeEntitySentimentRequest request = - AnalyzeEntitySentimentRequest.newBuilder().setDocument(document).build(); - return analyzeEntitySentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text - * and analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeEntitySentimentResponse response =
-   *       languageServiceClient.analyzeEntitySentiment(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( - Document document, EncodingType encodingType) { - AnalyzeEntitySentimentRequest request = - AnalyzeEntitySentimentRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeEntitySentiment(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text - * and analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitySentimentRequest request =
-   *       AnalyzeEntitySentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeEntitySentimentResponse response =
-   *       languageServiceClient.analyzeEntitySentiment(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 AnalyzeEntitySentimentResponse analyzeEntitySentiment( - AnalyzeEntitySentimentRequest request) { - return analyzeEntitySentimentCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Finds entities, similar to - * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text - * and analyzes sentiment associated with each entity and its mentions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeEntitySentimentRequest request =
-   *       AnalyzeEntitySentimentRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeEntitySentimentCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeEntitySentimentResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - analyzeEntitySentimentCallable() { - return stub.analyzeEntitySentimentCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { - AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder().setDocument(document).build(); - return analyzeSyntax(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType encodingType) { - AnalyzeSyntaxRequest request = - AnalyzeSyntaxRequest.newBuilder() - .setDocument(document) - .setEncodingType(encodingType) - .build(); - return analyzeSyntax(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSyntaxRequest request =
-   *       AnalyzeSyntaxRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(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 AnalyzeSyntaxResponse analyzeSyntax(AnalyzeSyntaxRequest request) { - return analyzeSyntaxCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with - * part of speech tags, dependency trees, and other properties. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnalyzeSyntaxRequest request =
-   *       AnalyzeSyntaxRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.analyzeSyntaxCallable().futureCall(request);
-   *   // Do something.
-   *   AnalyzeSyntaxResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable analyzeSyntaxCallable() { - return stub.analyzeSyntaxCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Classifies a document into categories. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   ClassifyTextResponse response = languageServiceClient.classifyText(document);
-   * }
-   * }
- * - * @param document Required. Input document. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ClassifyTextResponse classifyText(Document document) { - ClassifyTextRequest request = ClassifyTextRequest.newBuilder().setDocument(document).build(); - return classifyText(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Classifies a document into categories. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   ClassifyTextRequest request =
-   *       ClassifyTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build())
-   *           .build();
-   *   ClassifyTextResponse response = languageServiceClient.classifyText(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 ClassifyTextResponse classifyText(ClassifyTextRequest request) { - return classifyTextCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Classifies a document into categories. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   ClassifyTextRequest request =
-   *       ClassifyTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.classifyTextCallable().futureCall(request);
-   *   // Do something.
-   *   ClassifyTextResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable classifyTextCallable() { - return stub.classifyTextCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all syntax, sentiment, entity, and classification features - * in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
-   *   AnnotateTextResponse response = languageServiceClient.annotateText(document, features);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param features Required. The enabled features. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnnotateTextResponse annotateText( - Document document, AnnotateTextRequest.Features features) { - AnnotateTextRequest request = - AnnotateTextRequest.newBuilder().setDocument(document).setFeatures(features).build(); - return annotateText(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all syntax, sentiment, entity, and classification features - * in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   Document document = Document.newBuilder().build();
-   *   AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
-   *   EncodingType encodingType = EncodingType.forNumber(0);
-   *   AnnotateTextResponse response =
-   *       languageServiceClient.annotateText(document, features, encodingType);
-   * }
-   * }
- * - * @param document Required. Input document. - * @param features Required. The enabled features. - * @param encodingType The encoding type used by the API to calculate offsets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnnotateTextResponse annotateText( - Document document, AnnotateTextRequest.Features features, EncodingType encodingType) { - AnnotateTextRequest request = - AnnotateTextRequest.newBuilder() - .setDocument(document) - .setFeatures(features) - .setEncodingType(encodingType) - .build(); - return annotateText(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all syntax, sentiment, entity, and classification features - * in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnnotateTextRequest request =
-   *       AnnotateTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setFeatures(AnnotateTextRequest.Features.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   AnnotateTextResponse response = languageServiceClient.annotateText(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 AnnotateTextResponse annotateText(AnnotateTextRequest request) { - return annotateTextCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * A convenience method that provides all syntax, sentiment, entity, and classification features - * in one call. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
-   *   AnnotateTextRequest request =
-   *       AnnotateTextRequest.newBuilder()
-   *           .setDocument(Document.newBuilder().build())
-   *           .setFeatures(AnnotateTextRequest.Features.newBuilder().build())
-   *           .setEncodingType(EncodingType.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       languageServiceClient.annotateTextCallable().futureCall(request);
-   *   // Do something.
-   *   AnnotateTextResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable annotateTextCallable() { - return stub.annotateTextCallable(); - } - - @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-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java deleted file mode 100644 index 5d2d0dbb..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceSettings.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright 2022 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.language.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.httpjson.InstantiatingHttpJsonChannelProvider; -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.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.language.v1beta2.stub.LanguageServiceStubSettings; -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 LanguageServiceClient}. - * - *

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

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceSettings.Builder languageServiceSettingsBuilder =
- *     LanguageServiceSettings.newBuilder();
- * languageServiceSettingsBuilder
- *     .analyzeSentimentSettings()
- *     .setRetrySettings(
- *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * LanguageServiceSettings languageServiceSettings = languageServiceSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class LanguageServiceSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings - analyzeSentimentSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeSentimentSettings(); - } - - /** Returns the object with the settings used for calls to analyzeEntities. */ - public UnaryCallSettings - analyzeEntitiesSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeEntitiesSettings(); - } - - /** Returns the object with the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings - analyzeEntitySentimentSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeEntitySentimentSettings(); - } - - /** Returns the object with the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings analyzeSyntaxSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).analyzeSyntaxSettings(); - } - - /** Returns the object with the settings used for calls to classifyText. */ - public UnaryCallSettings classifyTextSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).classifyTextSettings(); - } - - /** Returns the object with the settings used for calls to annotateText. */ - public UnaryCallSettings annotateTextSettings() { - return ((LanguageServiceStubSettings) getStubSettings()).annotateTextSettings(); - } - - public static final LanguageServiceSettings create(LanguageServiceStubSettings stub) - throws IOException { - return new LanguageServiceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return LanguageServiceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return LanguageServiceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return LanguageServiceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return LanguageServiceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return LanguageServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return LanguageServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return LanguageServiceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return LanguageServiceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 LanguageServiceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for LanguageServiceSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(LanguageServiceStubSettings.newBuilder(clientContext)); - } - - protected Builder(LanguageServiceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(LanguageServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(LanguageServiceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(LanguageServiceStubSettings.newHttpJsonBuilder()); - } - - public LanguageServiceStubSettings.Builder getStubSettingsBuilder() { - return ((LanguageServiceStubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings.Builder - analyzeSentimentSettings() { - return getStubSettingsBuilder().analyzeSentimentSettings(); - } - - /** Returns the builder for the settings used for calls to analyzeEntities. */ - public UnaryCallSettings.Builder - analyzeEntitiesSettings() { - return getStubSettingsBuilder().analyzeEntitiesSettings(); - } - - /** Returns the builder for the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings.Builder - analyzeEntitySentimentSettings() { - return getStubSettingsBuilder().analyzeEntitySentimentSettings(); - } - - /** Returns the builder for the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings.Builder - analyzeSyntaxSettings() { - return getStubSettingsBuilder().analyzeSyntaxSettings(); - } - - /** Returns the builder for the settings used for calls to classifyText. */ - public UnaryCallSettings.Builder - classifyTextSettings() { - return getStubSettingsBuilder().classifyTextSettings(); - } - - /** Returns the builder for the settings used for calls to annotateText. */ - public UnaryCallSettings.Builder - annotateTextSettings() { - return getStubSettingsBuilder().annotateTextSettings(); - } - - @Override - public LanguageServiceSettings build() throws IOException { - return new LanguageServiceSettings(this); - } - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/gapic_metadata.json b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/gapic_metadata.json deleted file mode 100644 index 00621e6f..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/gapic_metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.cloud.language.v1beta2", - "libraryPackage": "com.google.cloud.language.v1beta2", - "services": { - "LanguageService": { - "clients": { - "grpc": { - "libraryClient": "LanguageServiceClient", - "rpcs": { - "AnalyzeEntities": { - "methods": ["analyzeEntities", "analyzeEntities", "analyzeEntities", "analyzeEntitiesCallable"] - }, - "AnalyzeEntitySentiment": { - "methods": ["analyzeEntitySentiment", "analyzeEntitySentiment", "analyzeEntitySentiment", "analyzeEntitySentimentCallable"] - }, - "AnalyzeSentiment": { - "methods": ["analyzeSentiment", "analyzeSentiment", "analyzeSentiment", "analyzeSentimentCallable"] - }, - "AnalyzeSyntax": { - "methods": ["analyzeSyntax", "analyzeSyntax", "analyzeSyntax", "analyzeSyntaxCallable"] - }, - "AnnotateText": { - "methods": ["annotateText", "annotateText", "annotateText", "annotateTextCallable"] - }, - "ClassifyText": { - "methods": ["classifyText", "classifyText", "classifyTextCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java deleted file mode 100644 index 9575cab4..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 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 Natural Language API - * - *

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

======================= LanguageServiceClient ======================= - * - *

Service Description: Provides text analysis operations such as sentiment analysis and entity - * recognition. - * - *

Sample for LanguageServiceClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
- *   Document document = Document.newBuilder().build();
- *   AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.cloud.language.v1beta2; - -import javax.annotation.Generated; diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceCallableFactory.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceCallableFactory.java deleted file mode 100644 index 8e87bd16..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2022 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.language.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.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the LanguageService service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcLanguageServiceCallableFactory 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 callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceStub.java deleted file mode 100644 index 50367841..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/GrpcLanguageServiceStub.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright 2022 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.language.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.UnaryCallable; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1beta2.AnnotateTextRequest; -import com.google.cloud.language.v1beta2.AnnotateTextResponse; -import com.google.cloud.language.v1beta2.ClassifyTextRequest; -import com.google.cloud.language.v1beta2.ClassifyTextResponse; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the LanguageService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcLanguageServiceStub extends LanguageServiceStub { - private static final MethodDescriptor - analyzeSentimentMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnalyzeSentiment") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeSentimentRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeSentimentResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - analyzeEntitiesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnalyzeEntities") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeEntitiesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeEntitiesResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor< - AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse> - analyzeEntitySentimentMethodDescriptor = - MethodDescriptor - .newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.language.v1beta2.LanguageService/AnalyzeEntitySentiment") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeEntitySentimentRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeEntitySentimentResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - analyzeSyntaxMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnalyzeSyntax") - .setRequestMarshaller( - ProtoUtils.marshaller(AnalyzeSyntaxRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnalyzeSyntaxResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - classifyTextMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/ClassifyText") - .setRequestMarshaller(ProtoUtils.marshaller(ClassifyTextRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ClassifyTextResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - annotateTextMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnnotateText") - .setRequestMarshaller(ProtoUtils.marshaller(AnnotateTextRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(AnnotateTextResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable - analyzeSentimentCallable; - private final UnaryCallable - analyzeEntitiesCallable; - private final UnaryCallable - analyzeEntitySentimentCallable; - private final UnaryCallable analyzeSyntaxCallable; - private final UnaryCallable classifyTextCallable; - private final UnaryCallable annotateTextCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcLanguageServiceStub create(LanguageServiceStubSettings settings) - throws IOException { - return new GrpcLanguageServiceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcLanguageServiceStub create(ClientContext clientContext) - throws IOException { - return new GrpcLanguageServiceStub( - LanguageServiceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcLanguageServiceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcLanguageServiceStub( - LanguageServiceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcLanguageServiceStub, 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 GrpcLanguageServiceStub( - LanguageServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcLanguageServiceCallableFactory()); - } - - /** - * Constructs an instance of GrpcLanguageServiceStub, 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 GrpcLanguageServiceStub( - LanguageServiceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings - analyzeSentimentTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeSentimentMethodDescriptor) - .build(); - GrpcCallSettings - analyzeEntitiesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeEntitiesMethodDescriptor) - .build(); - GrpcCallSettings - analyzeEntitySentimentTransportSettings = - GrpcCallSettings - .newBuilder() - .setMethodDescriptor(analyzeEntitySentimentMethodDescriptor) - .build(); - GrpcCallSettings analyzeSyntaxTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeSyntaxMethodDescriptor) - .build(); - GrpcCallSettings classifyTextTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(classifyTextMethodDescriptor) - .build(); - GrpcCallSettings annotateTextTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(annotateTextMethodDescriptor) - .build(); - - this.analyzeSentimentCallable = - callableFactory.createUnaryCallable( - analyzeSentimentTransportSettings, settings.analyzeSentimentSettings(), clientContext); - this.analyzeEntitiesCallable = - callableFactory.createUnaryCallable( - analyzeEntitiesTransportSettings, settings.analyzeEntitiesSettings(), clientContext); - this.analyzeEntitySentimentCallable = - callableFactory.createUnaryCallable( - analyzeEntitySentimentTransportSettings, - settings.analyzeEntitySentimentSettings(), - clientContext); - this.analyzeSyntaxCallable = - callableFactory.createUnaryCallable( - analyzeSyntaxTransportSettings, settings.analyzeSyntaxSettings(), clientContext); - this.classifyTextCallable = - callableFactory.createUnaryCallable( - classifyTextTransportSettings, settings.classifyTextSettings(), clientContext); - this.annotateTextCallable = - callableFactory.createUnaryCallable( - annotateTextTransportSettings, settings.annotateTextSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable - analyzeSentimentCallable() { - return analyzeSentimentCallable; - } - - @Override - public UnaryCallable analyzeEntitiesCallable() { - return analyzeEntitiesCallable; - } - - @Override - public UnaryCallable - analyzeEntitySentimentCallable() { - return analyzeEntitySentimentCallable; - } - - @Override - public UnaryCallable analyzeSyntaxCallable() { - return analyzeSyntaxCallable; - } - - @Override - public UnaryCallable classifyTextCallable() { - return classifyTextCallable; - } - - @Override - public UnaryCallable annotateTextCallable() { - return annotateTextCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceCallableFactory.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceCallableFactory.java deleted file mode 100644 index 6dc0b789..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2022 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.language.v1beta2.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the LanguageService service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonLanguageServiceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java deleted file mode 100644 index f177a261..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/HttpJsonLanguageServiceStub.java +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright 2022 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.language.v1beta2.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1beta2.AnnotateTextRequest; -import com.google.cloud.language.v1beta2.AnnotateTextResponse; -import com.google.cloud.language.v1beta2.ClassifyTextRequest; -import com.google.cloud.language.v1beta2.ClassifyTextResponse; -import com.google.protobuf.TypeRegistry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the LanguageService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonLanguageServiceStub extends LanguageServiceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - analyzeSentimentMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnalyzeSentiment") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta2/documents:analyzeSentiment", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeSentimentResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - analyzeEntitiesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnalyzeEntities") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta2/documents:analyzeEntities", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeEntitiesResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor< - AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse> - analyzeEntitySentimentMethodDescriptor = - ApiMethodDescriptor - .newBuilder() - .setFullMethodName( - "google.cloud.language.v1beta2.LanguageService/AnalyzeEntitySentiment") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta2/documents:analyzeEntitySentiment", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeEntitySentimentResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - analyzeSyntaxMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnalyzeSyntax") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta2/documents:analyzeSyntax", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnalyzeSyntaxResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - classifyTextMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/ClassifyText") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta2/documents:classifyText", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ClassifyTextResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - annotateTextMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.language.v1beta2.LanguageService/AnnotateText") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta2/documents:annotateText", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(AnnotateTextResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable - analyzeSentimentCallable; - private final UnaryCallable - analyzeEntitiesCallable; - private final UnaryCallable - analyzeEntitySentimentCallable; - private final UnaryCallable analyzeSyntaxCallable; - private final UnaryCallable classifyTextCallable; - private final UnaryCallable annotateTextCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonLanguageServiceStub create(LanguageServiceStubSettings settings) - throws IOException { - return new HttpJsonLanguageServiceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonLanguageServiceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonLanguageServiceStub( - LanguageServiceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonLanguageServiceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonLanguageServiceStub( - LanguageServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonLanguageServiceStub, 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 HttpJsonLanguageServiceStub( - LanguageServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new HttpJsonLanguageServiceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonLanguageServiceStub, 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 HttpJsonLanguageServiceStub( - LanguageServiceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings - analyzeSentimentTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(analyzeSentimentMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - analyzeEntitiesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(analyzeEntitiesMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - analyzeEntitySentimentTransportSettings = - HttpJsonCallSettings - .newBuilder() - .setMethodDescriptor(analyzeEntitySentimentMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - analyzeSyntaxTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(analyzeSyntaxMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings classifyTextTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(classifyTextMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings annotateTextTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(annotateTextMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.analyzeSentimentCallable = - callableFactory.createUnaryCallable( - analyzeSentimentTransportSettings, settings.analyzeSentimentSettings(), clientContext); - this.analyzeEntitiesCallable = - callableFactory.createUnaryCallable( - analyzeEntitiesTransportSettings, settings.analyzeEntitiesSettings(), clientContext); - this.analyzeEntitySentimentCallable = - callableFactory.createUnaryCallable( - analyzeEntitySentimentTransportSettings, - settings.analyzeEntitySentimentSettings(), - clientContext); - this.analyzeSyntaxCallable = - callableFactory.createUnaryCallable( - analyzeSyntaxTransportSettings, settings.analyzeSyntaxSettings(), clientContext); - this.classifyTextCallable = - callableFactory.createUnaryCallable( - classifyTextTransportSettings, settings.classifyTextSettings(), clientContext); - this.annotateTextCallable = - callableFactory.createUnaryCallable( - annotateTextTransportSettings, settings.annotateTextSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(analyzeSentimentMethodDescriptor); - methodDescriptors.add(analyzeEntitiesMethodDescriptor); - methodDescriptors.add(analyzeEntitySentimentMethodDescriptor); - methodDescriptors.add(analyzeSyntaxMethodDescriptor); - methodDescriptors.add(classifyTextMethodDescriptor); - methodDescriptors.add(annotateTextMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable - analyzeSentimentCallable() { - return analyzeSentimentCallable; - } - - @Override - public UnaryCallable analyzeEntitiesCallable() { - return analyzeEntitiesCallable; - } - - @Override - public UnaryCallable - analyzeEntitySentimentCallable() { - return analyzeEntitySentimentCallable; - } - - @Override - public UnaryCallable analyzeSyntaxCallable() { - return analyzeSyntaxCallable; - } - - @Override - public UnaryCallable classifyTextCallable() { - return classifyTextCallable; - } - - @Override - public UnaryCallable annotateTextCallable() { - return annotateTextCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStub.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStub.java deleted file mode 100644 index de46558e..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStub.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2022 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.language.v1beta2.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1beta2.AnnotateTextRequest; -import com.google.cloud.language.v1beta2.AnnotateTextResponse; -import com.google.cloud.language.v1beta2.ClassifyTextRequest; -import com.google.cloud.language.v1beta2.ClassifyTextResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the LanguageService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class LanguageServiceStub implements BackgroundResource { - - public UnaryCallable - analyzeSentimentCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeSentimentCallable()"); - } - - public UnaryCallable analyzeEntitiesCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeEntitiesCallable()"); - } - - public UnaryCallable - analyzeEntitySentimentCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeEntitySentimentCallable()"); - } - - public UnaryCallable analyzeSyntaxCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeSyntaxCallable()"); - } - - public UnaryCallable classifyTextCallable() { - throw new UnsupportedOperationException("Not implemented: classifyTextCallable()"); - } - - public UnaryCallable annotateTextCallable() { - throw new UnsupportedOperationException("Not implemented: annotateTextCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java deleted file mode 100644 index ea0e4565..00000000 --- a/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java +++ /dev/null @@ -1,470 +0,0 @@ -/* - * Copyright 2022 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.language.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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.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.language.v1beta2.AnalyzeEntitiesRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSentimentRequest; -import com.google.cloud.language.v1beta2.AnalyzeSentimentResponse; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest; -import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse; -import com.google.cloud.language.v1beta2.AnnotateTextRequest; -import com.google.cloud.language.v1beta2.AnnotateTextResponse; -import com.google.cloud.language.v1beta2.ClassifyTextRequest; -import com.google.cloud.language.v1beta2.ClassifyTextResponse; -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 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 LanguageServiceStub}. - * - *

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

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * LanguageServiceStubSettings.Builder languageServiceSettingsBuilder =
- *     LanguageServiceStubSettings.newBuilder();
- * languageServiceSettingsBuilder
- *     .analyzeSentimentSettings()
- *     .setRetrySettings(
- *         languageServiceSettingsBuilder.analyzeSentimentSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * LanguageServiceStubSettings languageServiceSettings = languageServiceSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class LanguageServiceStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-language") - .add("https://www.googleapis.com/auth/cloud-platform") - .build(); - - private final UnaryCallSettings - analyzeSentimentSettings; - private final UnaryCallSettings - analyzeEntitiesSettings; - private final UnaryCallSettings - analyzeEntitySentimentSettings; - private final UnaryCallSettings - analyzeSyntaxSettings; - private final UnaryCallSettings classifyTextSettings; - private final UnaryCallSettings annotateTextSettings; - - /** Returns the object with the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings - analyzeSentimentSettings() { - return analyzeSentimentSettings; - } - - /** Returns the object with the settings used for calls to analyzeEntities. */ - public UnaryCallSettings - analyzeEntitiesSettings() { - return analyzeEntitiesSettings; - } - - /** Returns the object with the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings - analyzeEntitySentimentSettings() { - return analyzeEntitySentimentSettings; - } - - /** Returns the object with the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings analyzeSyntaxSettings() { - return analyzeSyntaxSettings; - } - - /** Returns the object with the settings used for calls to classifyText. */ - public UnaryCallSettings classifyTextSettings() { - return classifyTextSettings; - } - - /** Returns the object with the settings used for calls to annotateText. */ - public UnaryCallSettings annotateTextSettings() { - return annotateTextSettings; - } - - public LanguageServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcLanguageServiceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonLanguageServiceStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", 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 "language.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "language.mtls.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) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - 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 defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(LanguageServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(LanguageServiceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return LanguageServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 LanguageServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - analyzeSentimentSettings = settingsBuilder.analyzeSentimentSettings().build(); - analyzeEntitiesSettings = settingsBuilder.analyzeEntitiesSettings().build(); - analyzeEntitySentimentSettings = settingsBuilder.analyzeEntitySentimentSettings().build(); - analyzeSyntaxSettings = settingsBuilder.analyzeSyntaxSettings().build(); - classifyTextSettings = settingsBuilder.classifyTextSettings().build(); - annotateTextSettings = settingsBuilder.annotateTextSettings().build(); - } - - /** Builder for LanguageServiceStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - analyzeSentimentSettings; - private final UnaryCallSettings.Builder - analyzeEntitiesSettings; - private final UnaryCallSettings.Builder< - AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse> - analyzeEntitySentimentSettings; - private final UnaryCallSettings.Builder - analyzeSyntaxSettings; - private final UnaryCallSettings.Builder - classifyTextSettings; - private final UnaryCallSettings.Builder - annotateTextSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); - 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(600000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(600000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - analyzeSentimentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - analyzeEntitiesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - analyzeEntitySentimentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - analyzeSyntaxSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - classifyTextSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - annotateTextSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - analyzeSentimentSettings, - analyzeEntitiesSettings, - analyzeEntitySentimentSettings, - analyzeSyntaxSettings, - classifyTextSettings, - annotateTextSettings); - initDefaults(this); - } - - protected Builder(LanguageServiceStubSettings settings) { - super(settings); - - analyzeSentimentSettings = settings.analyzeSentimentSettings.toBuilder(); - analyzeEntitiesSettings = settings.analyzeEntitiesSettings.toBuilder(); - analyzeEntitySentimentSettings = settings.analyzeEntitySentimentSettings.toBuilder(); - analyzeSyntaxSettings = settings.analyzeSyntaxSettings.toBuilder(); - classifyTextSettings = settings.classifyTextSettings.toBuilder(); - annotateTextSettings = settings.annotateTextSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - analyzeSentimentSettings, - analyzeEntitiesSettings, - analyzeEntitySentimentSettings, - analyzeSyntaxSettings, - classifyTextSettings, - annotateTextSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .analyzeSentimentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .analyzeEntitiesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .analyzeEntitySentimentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .analyzeSyntaxSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .classifyTextSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .annotateTextSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - return builder; - } - - /** - * 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) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to analyzeSentiment. */ - public UnaryCallSettings.Builder - analyzeSentimentSettings() { - return analyzeSentimentSettings; - } - - /** Returns the builder for the settings used for calls to analyzeEntities. */ - public UnaryCallSettings.Builder - analyzeEntitiesSettings() { - return analyzeEntitiesSettings; - } - - /** Returns the builder for the settings used for calls to analyzeEntitySentiment. */ - public UnaryCallSettings.Builder - analyzeEntitySentimentSettings() { - return analyzeEntitySentimentSettings; - } - - /** Returns the builder for the settings used for calls to analyzeSyntax. */ - public UnaryCallSettings.Builder - analyzeSyntaxSettings() { - return analyzeSyntaxSettings; - } - - /** Returns the builder for the settings used for calls to classifyText. */ - public UnaryCallSettings.Builder - classifyTextSettings() { - return classifyTextSettings; - } - - /** Returns the builder for the settings used for calls to annotateText. */ - public UnaryCallSettings.Builder - annotateTextSettings() { - return annotateTextSettings; - } - - @Override - public LanguageServiceStubSettings build() throws IOException { - return new LanguageServiceStubSettings(this); - } - } -} diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientHttpJsonTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientHttpJsonTest.java deleted file mode 100644 index 826e982e..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientHttpJsonTest.java +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright 2022 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.language.v1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.language.v1.stub.HttpJsonLanguageServiceStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class LanguageServiceClientHttpJsonTest { - private static MockHttpService mockService; - private static LanguageServiceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonLanguageServiceStub.getMethodDescriptors(), - LanguageServiceSettings.getDefaultEndpoint()); - LanguageServiceSettings settings = - LanguageServiceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = LanguageServiceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void analyzeSentimentTest() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSentimentExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSentimentTest2() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSentimentExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitiesExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntities(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest2() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitiesExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntities(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitySentimentResponse actualResponse = client.analyzeEntitySentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitySentimentExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntitySentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest2() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitySentimentResponse actualResponse = - client.analyzeEntitySentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitySentimentExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntitySentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSyntaxExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSyntax(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest2() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSyntaxExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSyntax(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void classifyTextTest() throws Exception { - ClassifyTextResponse expectedResponse = - ClassifyTextResponse.newBuilder() - .addAllCategories(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - ClassifyTextResponse actualResponse = client.classifyText(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void classifyTextExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.classifyText(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - - AnnotateTextResponse actualResponse = client.annotateText(document, features); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void annotateTextExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - client.annotateText(document, features); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest2() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnnotateTextResponse actualResponse = client.annotateText(document, features, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void annotateTextExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.annotateText(document, features, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java deleted file mode 100644 index a896aa72..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright 2022 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.language.v1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.protobuf.AbstractMessage; -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 javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class LanguageServiceClientTest { - private static MockLanguageService mockLanguageService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private LanguageServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockLanguageService = new MockLanguageService(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockLanguageService)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - LanguageServiceSettings settings = - LanguageServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = LanguageServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void analyzeSentimentTest() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSentimentRequest actualRequest = ((AnalyzeSentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSentimentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSentimentTest2() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSentimentRequest actualRequest = ((AnalyzeSentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSentimentExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitiesRequest actualRequest = ((AnalyzeEntitiesRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitiesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntities(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest2() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitiesRequest actualRequest = ((AnalyzeEntitiesRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitiesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntities(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitySentimentResponse actualResponse = client.analyzeEntitySentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitySentimentRequest actualRequest = - ((AnalyzeEntitySentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitySentimentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntitySentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest2() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitySentimentResponse actualResponse = - client.analyzeEntitySentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitySentimentRequest actualRequest = - ((AnalyzeEntitySentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitySentimentExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntitySentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSyntaxRequest actualRequest = ((AnalyzeSyntaxRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSyntaxExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSyntax(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest2() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSyntaxRequest actualRequest = ((AnalyzeSyntaxRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSyntaxExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSyntax(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void classifyTextTest() throws Exception { - ClassifyTextResponse expectedResponse = - ClassifyTextResponse.newBuilder() - .addAllCategories(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - ClassifyTextResponse actualResponse = client.classifyText(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ClassifyTextRequest actualRequest = ((ClassifyTextRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void classifyTextExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.classifyText(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - - AnnotateTextResponse actualResponse = client.annotateText(document, features); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnnotateTextRequest actualRequest = ((AnnotateTextRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(features, actualRequest.getFeatures()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void annotateTextExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - client.annotateText(document, features); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest2() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnnotateTextResponse actualResponse = client.annotateText(document, features, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnnotateTextRequest actualRequest = ((AnnotateTextRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(features, actualRequest.getFeatures()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void annotateTextExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.annotateText(document, features, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageService.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageService.java deleted file mode 100644 index ce5bbe58..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 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.language.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockLanguageService implements MockGrpcService { - private final MockLanguageServiceImpl serviceImpl; - - public MockLanguageService() { - serviceImpl = new MockLanguageServiceImpl(); - } - - @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-language/src/test/java/com/google/cloud/language/v1/MockLanguageServiceImpl.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageServiceImpl.java deleted file mode 100644 index a7eddf3e..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1/MockLanguageServiceImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2022 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.language.v1; - -import com.google.api.core.BetaApi; -import com.google.cloud.language.v1.LanguageServiceGrpc.LanguageServiceImplBase; -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; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockLanguageServiceImpl extends LanguageServiceImplBase { - private List requests; - private Queue responses; - - public MockLanguageServiceImpl() { - 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 analyzeSentiment( - AnalyzeSentimentRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeSentimentResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeSentimentResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeSentiment, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeSentimentResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void analyzeEntities( - AnalyzeEntitiesRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeEntitiesResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeEntitiesResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeEntities, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeEntitiesResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void analyzeEntitySentiment( - AnalyzeEntitySentimentRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeEntitySentimentResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeEntitySentimentResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeEntitySentiment, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeEntitySentimentResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void analyzeSyntax( - AnalyzeSyntaxRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeSyntaxResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeSyntaxResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeSyntax, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeSyntaxResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void classifyText( - ClassifyTextRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ClassifyTextResponse) { - requests.add(request); - responseObserver.onNext(((ClassifyTextResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ClassifyText, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ClassifyTextResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void annotateText( - AnnotateTextRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnnotateTextResponse) { - requests.add(request); - responseObserver.onNext(((AnnotateTextResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnnotateText, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnnotateTextResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientHttpJsonTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientHttpJsonTest.java deleted file mode 100644 index 265854d8..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientHttpJsonTest.java +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright 2022 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.language.v1beta2; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.language.v1beta2.stub.HttpJsonLanguageServiceStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class LanguageServiceClientHttpJsonTest { - private static MockHttpService mockService; - private static LanguageServiceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonLanguageServiceStub.getMethodDescriptors(), - LanguageServiceSettings.getDefaultEndpoint()); - LanguageServiceSettings settings = - LanguageServiceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = LanguageServiceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void analyzeSentimentTest() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSentimentExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSentimentTest2() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSentimentExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitiesExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntities(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest2() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitiesExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntities(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitySentimentResponse actualResponse = client.analyzeEntitySentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitySentimentExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntitySentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest2() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitySentimentResponse actualResponse = - client.analyzeEntitySentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeEntitySentimentExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntitySentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSyntaxExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSyntax(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest2() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void analyzeSyntaxExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSyntax(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void classifyTextTest() throws Exception { - ClassifyTextResponse expectedResponse = - ClassifyTextResponse.newBuilder() - .addAllCategories(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - ClassifyTextResponse actualResponse = client.classifyText(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void classifyTextExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.classifyText(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - - AnnotateTextResponse actualResponse = client.annotateText(document, features); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void annotateTextExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - client.annotateText(document, features); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest2() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnnotateTextResponse actualResponse = client.annotateText(document, features, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void annotateTextExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.annotateText(document, features, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientTest.java deleted file mode 100644 index fba3f927..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/LanguageServiceClientTest.java +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright 2022 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.language.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.protobuf.AbstractMessage; -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 javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class LanguageServiceClientTest { - private static MockLanguageService mockLanguageService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private LanguageServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockLanguageService = new MockLanguageService(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockLanguageService)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - LanguageServiceSettings settings = - LanguageServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = LanguageServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void analyzeSentimentTest() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSentimentRequest actualRequest = ((AnalyzeSentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSentimentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSentimentTest2() throws Exception { - AnalyzeSentimentResponse expectedResponse = - AnalyzeSentimentResponse.newBuilder() - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllSentences(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSentimentRequest actualRequest = ((AnalyzeSentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSentimentExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitiesRequest actualRequest = ((AnalyzeEntitiesRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitiesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntities(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitiesTest2() throws Exception { - AnalyzeEntitiesResponse expectedResponse = - AnalyzeEntitiesResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitiesResponse actualResponse = client.analyzeEntities(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitiesRequest actualRequest = ((AnalyzeEntitiesRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitiesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntities(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeEntitySentimentResponse actualResponse = client.analyzeEntitySentiment(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitySentimentRequest actualRequest = - ((AnalyzeEntitySentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitySentimentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeEntitySentiment(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeEntitySentimentTest2() throws Exception { - AnalyzeEntitySentimentResponse expectedResponse = - AnalyzeEntitySentimentResponse.newBuilder() - .addAllEntities(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeEntitySentimentResponse actualResponse = - client.analyzeEntitySentiment(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeEntitySentimentRequest actualRequest = - ((AnalyzeEntitySentimentRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeEntitySentimentExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeEntitySentiment(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSyntaxRequest actualRequest = ((AnalyzeSyntaxRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSyntaxExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.analyzeSyntax(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void analyzeSyntaxTest2() throws Exception { - AnalyzeSyntaxResponse expectedResponse = - AnalyzeSyntaxResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .setLanguage("language-1613589672") - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnalyzeSyntaxResponse actualResponse = client.analyzeSyntax(document, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnalyzeSyntaxRequest actualRequest = ((AnalyzeSyntaxRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void analyzeSyntaxExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.analyzeSyntax(document, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void classifyTextTest() throws Exception { - ClassifyTextResponse expectedResponse = - ClassifyTextResponse.newBuilder() - .addAllCategories(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - - ClassifyTextResponse actualResponse = client.classifyText(document); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ClassifyTextRequest actualRequest = ((ClassifyTextRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void classifyTextExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - client.classifyText(document); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - - AnnotateTextResponse actualResponse = client.annotateText(document, features); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnnotateTextRequest actualRequest = ((AnnotateTextRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(features, actualRequest.getFeatures()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void annotateTextExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - client.annotateText(document, features); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void annotateTextTest2() throws Exception { - AnnotateTextResponse expectedResponse = - AnnotateTextResponse.newBuilder() - .addAllSentences(new ArrayList()) - .addAllTokens(new ArrayList()) - .addAllEntities(new ArrayList()) - .setDocumentSentiment(Sentiment.newBuilder().build()) - .setLanguage("language-1613589672") - .addAllCategories(new ArrayList()) - .build(); - mockLanguageService.addResponse(expectedResponse); - - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - - AnnotateTextResponse actualResponse = client.annotateText(document, features, encodingType); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLanguageService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AnnotateTextRequest actualRequest = ((AnnotateTextRequest) actualRequests.get(0)); - - Assert.assertEquals(document, actualRequest.getDocument()); - Assert.assertEquals(features, actualRequest.getFeatures()); - Assert.assertEquals(encodingType, actualRequest.getEncodingType()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void annotateTextExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockLanguageService.addException(exception); - - try { - Document document = Document.newBuilder().build(); - AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); - EncodingType encodingType = EncodingType.forNumber(0); - client.annotateText(document, features, encodingType); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageService.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageService.java deleted file mode 100644 index eae1bb3b..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 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.language.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; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockLanguageService implements MockGrpcService { - private final MockLanguageServiceImpl serviceImpl; - - public MockLanguageService() { - serviceImpl = new MockLanguageServiceImpl(); - } - - @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-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageServiceImpl.java b/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageServiceImpl.java deleted file mode 100644 index 9f0d390c..00000000 --- a/google-cloud-language/src/test/java/com/google/cloud/language/v1beta2/MockLanguageServiceImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2022 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.language.v1beta2; - -import com.google.api.core.BetaApi; -import com.google.cloud.language.v1beta2.LanguageServiceGrpc.LanguageServiceImplBase; -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; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockLanguageServiceImpl extends LanguageServiceImplBase { - private List requests; - private Queue responses; - - public MockLanguageServiceImpl() { - 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 analyzeSentiment( - AnalyzeSentimentRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeSentimentResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeSentimentResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeSentiment, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeSentimentResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void analyzeEntities( - AnalyzeEntitiesRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeEntitiesResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeEntitiesResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeEntities, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeEntitiesResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void analyzeEntitySentiment( - AnalyzeEntitySentimentRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeEntitySentimentResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeEntitySentimentResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeEntitySentiment, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeEntitySentimentResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void analyzeSyntax( - AnalyzeSyntaxRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnalyzeSyntaxResponse) { - requests.add(request); - responseObserver.onNext(((AnalyzeSyntaxResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnalyzeSyntax, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnalyzeSyntaxResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void classifyText( - ClassifyTextRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ClassifyTextResponse) { - requests.add(request); - responseObserver.onNext(((ClassifyTextResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ClassifyText, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ClassifyTextResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void annotateText( - AnnotateTextRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof AnnotateTextResponse) { - requests.add(request); - responseObserver.onNext(((AnnotateTextResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method AnnotateText, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - AnnotateTextResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/grpc-google-cloud-language-v1/pom.xml b/grpc-google-cloud-language-v1/pom.xml deleted file mode 100644 index e806007d..00000000 --- a/grpc-google-cloud-language-v1/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-language-v1 - 2.4.2-SNAPSHOT - grpc-google-cloud-language-v1 - GRPC library for grpc-google-cloud-language-v1 - - com.google.cloud - google-cloud-language-parent - 2.4.2-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-cloud-language-v1 - - - com.google.guava - guava - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java b/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java deleted file mode 100644 index bf571966..00000000 --- a/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java +++ /dev/null @@ -1,1001 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.language.v1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * Provides text analysis operations such as sentiment analysis and entity
- * recognition.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/language/v1/language_service.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class LanguageServiceGrpc { - - private LanguageServiceGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.language.v1.LanguageService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeSentimentRequest, - com.google.cloud.language.v1.AnalyzeSentimentResponse> - getAnalyzeSentimentMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeSentiment", - requestType = com.google.cloud.language.v1.AnalyzeSentimentRequest.class, - responseType = com.google.cloud.language.v1.AnalyzeSentimentResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeSentimentRequest, - com.google.cloud.language.v1.AnalyzeSentimentResponse> - getAnalyzeSentimentMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeSentimentRequest, - com.google.cloud.language.v1.AnalyzeSentimentResponse> - getAnalyzeSentimentMethod; - if ((getAnalyzeSentimentMethod = LanguageServiceGrpc.getAnalyzeSentimentMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeSentimentMethod = LanguageServiceGrpc.getAnalyzeSentimentMethod) == null) { - LanguageServiceGrpc.getAnalyzeSentimentMethod = - getAnalyzeSentimentMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnalyzeSentiment")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeSentimentRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeSentimentResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeSentiment")) - .build(); - } - } - } - return getAnalyzeSentimentMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeEntitiesRequest, - com.google.cloud.language.v1.AnalyzeEntitiesResponse> - getAnalyzeEntitiesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeEntities", - requestType = com.google.cloud.language.v1.AnalyzeEntitiesRequest.class, - responseType = com.google.cloud.language.v1.AnalyzeEntitiesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeEntitiesRequest, - com.google.cloud.language.v1.AnalyzeEntitiesResponse> - getAnalyzeEntitiesMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeEntitiesRequest, - com.google.cloud.language.v1.AnalyzeEntitiesResponse> - getAnalyzeEntitiesMethod; - if ((getAnalyzeEntitiesMethod = LanguageServiceGrpc.getAnalyzeEntitiesMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeEntitiesMethod = LanguageServiceGrpc.getAnalyzeEntitiesMethod) == null) { - LanguageServiceGrpc.getAnalyzeEntitiesMethod = - getAnalyzeEntitiesMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnalyzeEntities")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeEntitiesRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeEntitiesResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeEntities")) - .build(); - } - } - } - return getAnalyzeEntitiesMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse> - getAnalyzeEntitySentimentMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeEntitySentiment", - requestType = com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.class, - responseType = com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse> - getAnalyzeEntitySentimentMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse> - getAnalyzeEntitySentimentMethod; - if ((getAnalyzeEntitySentimentMethod = LanguageServiceGrpc.getAnalyzeEntitySentimentMethod) - == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeEntitySentimentMethod = LanguageServiceGrpc.getAnalyzeEntitySentimentMethod) - == null) { - LanguageServiceGrpc.getAnalyzeEntitySentimentMethod = - getAnalyzeEntitySentimentMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "AnalyzeEntitySentiment")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeEntitySentiment")) - .build(); - } - } - } - return getAnalyzeEntitySentimentMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeSyntaxRequest, - com.google.cloud.language.v1.AnalyzeSyntaxResponse> - getAnalyzeSyntaxMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeSyntax", - requestType = com.google.cloud.language.v1.AnalyzeSyntaxRequest.class, - responseType = com.google.cloud.language.v1.AnalyzeSyntaxResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeSyntaxRequest, - com.google.cloud.language.v1.AnalyzeSyntaxResponse> - getAnalyzeSyntaxMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnalyzeSyntaxRequest, - com.google.cloud.language.v1.AnalyzeSyntaxResponse> - getAnalyzeSyntaxMethod; - if ((getAnalyzeSyntaxMethod = LanguageServiceGrpc.getAnalyzeSyntaxMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeSyntaxMethod = LanguageServiceGrpc.getAnalyzeSyntaxMethod) == null) { - LanguageServiceGrpc.getAnalyzeSyntaxMethod = - getAnalyzeSyntaxMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnalyzeSyntax")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeSyntaxRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnalyzeSyntaxResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeSyntax")) - .build(); - } - } - } - return getAnalyzeSyntaxMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1.ClassifyTextRequest, - com.google.cloud.language.v1.ClassifyTextResponse> - getClassifyTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ClassifyText", - requestType = com.google.cloud.language.v1.ClassifyTextRequest.class, - responseType = com.google.cloud.language.v1.ClassifyTextResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1.ClassifyTextRequest, - com.google.cloud.language.v1.ClassifyTextResponse> - getClassifyTextMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1.ClassifyTextRequest, - com.google.cloud.language.v1.ClassifyTextResponse> - getClassifyTextMethod; - if ((getClassifyTextMethod = LanguageServiceGrpc.getClassifyTextMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getClassifyTextMethod = LanguageServiceGrpc.getClassifyTextMethod) == null) { - LanguageServiceGrpc.getClassifyTextMethod = - getClassifyTextMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ClassifyText")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.ClassifyTextRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.ClassifyTextResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("ClassifyText")) - .build(); - } - } - } - return getClassifyTextMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnnotateTextRequest, - com.google.cloud.language.v1.AnnotateTextResponse> - getAnnotateTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnnotateText", - requestType = com.google.cloud.language.v1.AnnotateTextRequest.class, - responseType = com.google.cloud.language.v1.AnnotateTextResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnnotateTextRequest, - com.google.cloud.language.v1.AnnotateTextResponse> - getAnnotateTextMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1.AnnotateTextRequest, - com.google.cloud.language.v1.AnnotateTextResponse> - getAnnotateTextMethod; - if ((getAnnotateTextMethod = LanguageServiceGrpc.getAnnotateTextMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnnotateTextMethod = LanguageServiceGrpc.getAnnotateTextMethod) == null) { - LanguageServiceGrpc.getAnnotateTextMethod = - getAnnotateTextMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnnotateText")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnnotateTextRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1.AnnotateTextResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnnotateText")) - .build(); - } - } - } - return getAnnotateTextMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static LanguageServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public LanguageServiceStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceStub(channel, callOptions); - } - }; - return LanguageServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static LanguageServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public LanguageServiceBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceBlockingStub(channel, callOptions); - } - }; - return LanguageServiceBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static LanguageServiceFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public LanguageServiceFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceFutureStub(channel, callOptions); - } - }; - return LanguageServiceFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public abstract static class LanguageServiceImplBase implements io.grpc.BindableService { - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public void analyzeSentiment( - com.google.cloud.language.v1.AnalyzeSentimentRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeSentimentMethod(), responseObserver); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public void analyzeEntities( - com.google.cloud.language.v1.AnalyzeEntitiesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeEntitiesMethod(), responseObserver); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public void analyzeEntitySentiment( - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeEntitySentimentMethod(), responseObserver); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public void analyzeSyntax( - com.google.cloud.language.v1.AnalyzeSyntaxRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeSyntaxMethod(), responseObserver); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public void classifyText( - com.google.cloud.language.v1.ClassifyTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getClassifyTextMethod(), responseObserver); - } - - /** - * - * - *
-     * A convenience method that provides all the features that analyzeSentiment,
-     * analyzeEntities, and analyzeSyntax provide in one call.
-     * 
- */ - public void annotateText( - com.google.cloud.language.v1.AnnotateTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnnotateTextMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getAnalyzeSentimentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1.AnalyzeSentimentRequest, - com.google.cloud.language.v1.AnalyzeSentimentResponse>( - this, METHODID_ANALYZE_SENTIMENT))) - .addMethod( - getAnalyzeEntitiesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1.AnalyzeEntitiesRequest, - com.google.cloud.language.v1.AnalyzeEntitiesResponse>( - this, METHODID_ANALYZE_ENTITIES))) - .addMethod( - getAnalyzeEntitySentimentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse>( - this, METHODID_ANALYZE_ENTITY_SENTIMENT))) - .addMethod( - getAnalyzeSyntaxMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1.AnalyzeSyntaxRequest, - com.google.cloud.language.v1.AnalyzeSyntaxResponse>( - this, METHODID_ANALYZE_SYNTAX))) - .addMethod( - getClassifyTextMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1.ClassifyTextRequest, - com.google.cloud.language.v1.ClassifyTextResponse>( - this, METHODID_CLASSIFY_TEXT))) - .addMethod( - getAnnotateTextMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1.AnnotateTextRequest, - com.google.cloud.language.v1.AnnotateTextResponse>( - this, METHODID_ANNOTATE_TEXT))) - .build(); - } - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public static final class LanguageServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private LanguageServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LanguageServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceStub(channel, callOptions); - } - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public void analyzeSentiment( - com.google.cloud.language.v1.AnalyzeSentimentRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeSentimentMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public void analyzeEntities( - com.google.cloud.language.v1.AnalyzeEntitiesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeEntitiesMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public void analyzeEntitySentiment( - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeEntitySentimentMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public void analyzeSyntax( - com.google.cloud.language.v1.AnalyzeSyntaxRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeSyntaxMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public void classifyText( - com.google.cloud.language.v1.ClassifyTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getClassifyTextMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * A convenience method that provides all the features that analyzeSentiment,
-     * analyzeEntities, and analyzeSyntax provide in one call.
-     * 
- */ - public void annotateText( - com.google.cloud.language.v1.AnnotateTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnnotateTextMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public static final class LanguageServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private LanguageServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LanguageServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public com.google.cloud.language.v1.AnalyzeSentimentResponse analyzeSentiment( - com.google.cloud.language.v1.AnalyzeSentimentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeSentimentMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public com.google.cloud.language.v1.AnalyzeEntitiesResponse analyzeEntities( - com.google.cloud.language.v1.AnalyzeEntitiesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeEntitiesMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse analyzeEntitySentiment( - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeEntitySentimentMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public com.google.cloud.language.v1.AnalyzeSyntaxResponse analyzeSyntax( - com.google.cloud.language.v1.AnalyzeSyntaxRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeSyntaxMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public com.google.cloud.language.v1.ClassifyTextResponse classifyText( - com.google.cloud.language.v1.ClassifyTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getClassifyTextMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * A convenience method that provides all the features that analyzeSentiment,
-     * analyzeEntities, and analyzeSyntax provide in one call.
-     * 
- */ - public com.google.cloud.language.v1.AnnotateTextResponse annotateText( - com.google.cloud.language.v1.AnnotateTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnnotateTextMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public static final class LanguageServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private LanguageServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LanguageServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1.AnalyzeSentimentResponse> - analyzeSentiment(com.google.cloud.language.v1.AnalyzeSentimentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeSentimentMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1.AnalyzeEntitiesResponse> - analyzeEntities(com.google.cloud.language.v1.AnalyzeEntitiesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeEntitiesMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse> - analyzeEntitySentiment(com.google.cloud.language.v1.AnalyzeEntitySentimentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeEntitySentimentMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1.AnalyzeSyntaxResponse> - analyzeSyntax(com.google.cloud.language.v1.AnalyzeSyntaxRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeSyntaxMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1.ClassifyTextResponse> - classifyText(com.google.cloud.language.v1.ClassifyTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getClassifyTextMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * A convenience method that provides all the features that analyzeSentiment,
-     * analyzeEntities, and analyzeSyntax provide in one call.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1.AnnotateTextResponse> - annotateText(com.google.cloud.language.v1.AnnotateTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnnotateTextMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_ANALYZE_SENTIMENT = 0; - private static final int METHODID_ANALYZE_ENTITIES = 1; - private static final int METHODID_ANALYZE_ENTITY_SENTIMENT = 2; - private static final int METHODID_ANALYZE_SYNTAX = 3; - private static final int METHODID_CLASSIFY_TEXT = 4; - private static final int METHODID_ANNOTATE_TEXT = 5; - - 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 LanguageServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(LanguageServiceImplBase 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_ANALYZE_SENTIMENT: - serviceImpl.analyzeSentiment( - (com.google.cloud.language.v1.AnalyzeSentimentRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_ANALYZE_ENTITIES: - serviceImpl.analyzeEntities( - (com.google.cloud.language.v1.AnalyzeEntitiesRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_ANALYZE_ENTITY_SENTIMENT: - serviceImpl.analyzeEntitySentiment( - (com.google.cloud.language.v1.AnalyzeEntitySentimentRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse>) - responseObserver); - break; - case METHODID_ANALYZE_SYNTAX: - serviceImpl.analyzeSyntax( - (com.google.cloud.language.v1.AnalyzeSyntaxRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_CLASSIFY_TEXT: - serviceImpl.classifyText( - (com.google.cloud.language.v1.ClassifyTextRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_ANNOTATE_TEXT: - serviceImpl.annotateText( - (com.google.cloud.language.v1.AnnotateTextRequest) 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 LanguageServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - LanguageServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("LanguageService"); - } - } - - private static final class LanguageServiceFileDescriptorSupplier - extends LanguageServiceBaseDescriptorSupplier { - LanguageServiceFileDescriptorSupplier() {} - } - - private static final class LanguageServiceMethodDescriptorSupplier - extends LanguageServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - LanguageServiceMethodDescriptorSupplier(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 (LanguageServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new LanguageServiceFileDescriptorSupplier()) - .addMethod(getAnalyzeSentimentMethod()) - .addMethod(getAnalyzeEntitiesMethod()) - .addMethod(getAnalyzeEntitySentimentMethod()) - .addMethod(getAnalyzeSyntaxMethod()) - .addMethod(getClassifyTextMethod()) - .addMethod(getAnnotateTextMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/grpc-google-cloud-language-v1beta2/pom.xml b/grpc-google-cloud-language-v1beta2/pom.xml deleted file mode 100644 index fed435ad..00000000 --- a/grpc-google-cloud-language-v1beta2/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-language-v1beta2 - 0.91.2-SNAPSHOT - grpc-google-cloud-language-v1beta2 - GRPC library for grpc-google-cloud-language-v1beta2 - - com.google.cloud - google-cloud-language-parent - 2.4.2-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-cloud-language-v1beta2 - - - com.google.guava - guava - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java b/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java deleted file mode 100644 index bfe3452d..00000000 --- a/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java +++ /dev/null @@ -1,1006 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.cloud.language.v1beta2; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * Provides text analysis operations such as sentiment analysis and entity
- * recognition.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/language/v1beta2/language_service.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class LanguageServiceGrpc { - - private LanguageServiceGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.language.v1beta2.LanguageService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse> - getAnalyzeSentimentMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeSentiment", - requestType = com.google.cloud.language.v1beta2.AnalyzeSentimentRequest.class, - responseType = com.google.cloud.language.v1beta2.AnalyzeSentimentResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse> - getAnalyzeSentimentMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse> - getAnalyzeSentimentMethod; - if ((getAnalyzeSentimentMethod = LanguageServiceGrpc.getAnalyzeSentimentMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeSentimentMethod = LanguageServiceGrpc.getAnalyzeSentimentMethod) == null) { - LanguageServiceGrpc.getAnalyzeSentimentMethod = - getAnalyzeSentimentMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnalyzeSentiment")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeSentiment")) - .build(); - } - } - } - return getAnalyzeSentimentMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse> - getAnalyzeEntitiesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeEntities", - requestType = com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest.class, - responseType = com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse> - getAnalyzeEntitiesMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse> - getAnalyzeEntitiesMethod; - if ((getAnalyzeEntitiesMethod = LanguageServiceGrpc.getAnalyzeEntitiesMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeEntitiesMethod = LanguageServiceGrpc.getAnalyzeEntitiesMethod) == null) { - LanguageServiceGrpc.getAnalyzeEntitiesMethod = - getAnalyzeEntitiesMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnalyzeEntities")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeEntities")) - .build(); - } - } - } - return getAnalyzeEntitiesMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse> - getAnalyzeEntitySentimentMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeEntitySentiment", - requestType = com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.class, - responseType = com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse> - getAnalyzeEntitySentimentMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse> - getAnalyzeEntitySentimentMethod; - if ((getAnalyzeEntitySentimentMethod = LanguageServiceGrpc.getAnalyzeEntitySentimentMethod) - == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeEntitySentimentMethod = LanguageServiceGrpc.getAnalyzeEntitySentimentMethod) - == null) { - LanguageServiceGrpc.getAnalyzeEntitySentimentMethod = - getAnalyzeEntitySentimentMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "AnalyzeEntitySentiment")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeEntitySentiment")) - .build(); - } - } - } - return getAnalyzeEntitySentimentMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse> - getAnalyzeSyntaxMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnalyzeSyntax", - requestType = com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest.class, - responseType = com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse> - getAnalyzeSyntaxMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse> - getAnalyzeSyntaxMethod; - if ((getAnalyzeSyntaxMethod = LanguageServiceGrpc.getAnalyzeSyntaxMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnalyzeSyntaxMethod = LanguageServiceGrpc.getAnalyzeSyntaxMethod) == null) { - LanguageServiceGrpc.getAnalyzeSyntaxMethod = - getAnalyzeSyntaxMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnalyzeSyntax")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnalyzeSyntax")) - .build(); - } - } - } - return getAnalyzeSyntaxMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.ClassifyTextRequest, - com.google.cloud.language.v1beta2.ClassifyTextResponse> - getClassifyTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ClassifyText", - requestType = com.google.cloud.language.v1beta2.ClassifyTextRequest.class, - responseType = com.google.cloud.language.v1beta2.ClassifyTextResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.ClassifyTextRequest, - com.google.cloud.language.v1beta2.ClassifyTextResponse> - getClassifyTextMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.ClassifyTextRequest, - com.google.cloud.language.v1beta2.ClassifyTextResponse> - getClassifyTextMethod; - if ((getClassifyTextMethod = LanguageServiceGrpc.getClassifyTextMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getClassifyTextMethod = LanguageServiceGrpc.getClassifyTextMethod) == null) { - LanguageServiceGrpc.getClassifyTextMethod = - getClassifyTextMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ClassifyText")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.ClassifyTextRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.ClassifyTextResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("ClassifyText")) - .build(); - } - } - } - return getClassifyTextMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnnotateTextRequest, - com.google.cloud.language.v1beta2.AnnotateTextResponse> - getAnnotateTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AnnotateText", - requestType = com.google.cloud.language.v1beta2.AnnotateTextRequest.class, - responseType = com.google.cloud.language.v1beta2.AnnotateTextResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnnotateTextRequest, - com.google.cloud.language.v1beta2.AnnotateTextResponse> - getAnnotateTextMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.language.v1beta2.AnnotateTextRequest, - com.google.cloud.language.v1beta2.AnnotateTextResponse> - getAnnotateTextMethod; - if ((getAnnotateTextMethod = LanguageServiceGrpc.getAnnotateTextMethod) == null) { - synchronized (LanguageServiceGrpc.class) { - if ((getAnnotateTextMethod = LanguageServiceGrpc.getAnnotateTextMethod) == null) { - LanguageServiceGrpc.getAnnotateTextMethod = - getAnnotateTextMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AnnotateText")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnnotateTextRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.language.v1beta2.AnnotateTextResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new LanguageServiceMethodDescriptorSupplier("AnnotateText")) - .build(); - } - } - } - return getAnnotateTextMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static LanguageServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public LanguageServiceStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceStub(channel, callOptions); - } - }; - return LanguageServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static LanguageServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public LanguageServiceBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceBlockingStub(channel, callOptions); - } - }; - return LanguageServiceBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static LanguageServiceFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public LanguageServiceFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceFutureStub(channel, callOptions); - } - }; - return LanguageServiceFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public abstract static class LanguageServiceImplBase implements io.grpc.BindableService { - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public void analyzeSentiment( - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeSentimentMethod(), responseObserver); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public void analyzeEntities( - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeEntitiesMethod(), responseObserver); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public void analyzeEntitySentiment( - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse> - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeEntitySentimentMethod(), responseObserver); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public void analyzeSyntax( - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnalyzeSyntaxMethod(), responseObserver); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public void classifyText( - com.google.cloud.language.v1beta2.ClassifyTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getClassifyTextMethod(), responseObserver); - } - - /** - * - * - *
-     * A convenience method that provides all syntax, sentiment, entity, and
-     * classification features in one call.
-     * 
- */ - public void annotateText( - com.google.cloud.language.v1beta2.AnnotateTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAnnotateTextMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getAnalyzeSentimentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse>( - this, METHODID_ANALYZE_SENTIMENT))) - .addMethod( - getAnalyzeEntitiesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse>( - this, METHODID_ANALYZE_ENTITIES))) - .addMethod( - getAnalyzeEntitySentimentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse>( - this, METHODID_ANALYZE_ENTITY_SENTIMENT))) - .addMethod( - getAnalyzeSyntaxMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse>( - this, METHODID_ANALYZE_SYNTAX))) - .addMethod( - getClassifyTextMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1beta2.ClassifyTextRequest, - com.google.cloud.language.v1beta2.ClassifyTextResponse>( - this, METHODID_CLASSIFY_TEXT))) - .addMethod( - getAnnotateTextMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.language.v1beta2.AnnotateTextRequest, - com.google.cloud.language.v1beta2.AnnotateTextResponse>( - this, METHODID_ANNOTATE_TEXT))) - .build(); - } - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public static final class LanguageServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private LanguageServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LanguageServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceStub(channel, callOptions); - } - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public void analyzeSentiment( - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeSentimentMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public void analyzeEntities( - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeEntitiesMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public void analyzeEntitySentiment( - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse> - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeEntitySentimentMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public void analyzeSyntax( - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnalyzeSyntaxMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public void classifyText( - com.google.cloud.language.v1beta2.ClassifyTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getClassifyTextMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * A convenience method that provides all syntax, sentiment, entity, and
-     * classification features in one call.
-     * 
- */ - public void annotateText( - com.google.cloud.language.v1beta2.AnnotateTextRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAnnotateTextMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public static final class LanguageServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private LanguageServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LanguageServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public com.google.cloud.language.v1beta2.AnalyzeSentimentResponse analyzeSentiment( - com.google.cloud.language.v1beta2.AnalyzeSentimentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeSentimentMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse analyzeEntities( - com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeEntitiesMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse analyzeEntitySentiment( - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeEntitySentimentMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse analyzeSyntax( - com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnalyzeSyntaxMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public com.google.cloud.language.v1beta2.ClassifyTextResponse classifyText( - com.google.cloud.language.v1beta2.ClassifyTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getClassifyTextMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * A convenience method that provides all syntax, sentiment, entity, and
-     * classification features in one call.
-     * 
- */ - public com.google.cloud.language.v1beta2.AnnotateTextResponse annotateText( - com.google.cloud.language.v1beta2.AnnotateTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAnnotateTextMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Provides text analysis operations such as sentiment analysis and entity
-   * recognition.
-   * 
- */ - public static final class LanguageServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private LanguageServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LanguageServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new LanguageServiceFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Analyzes the sentiment of the provided text.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse> - analyzeSentiment(com.google.cloud.language.v1beta2.AnalyzeSentimentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeSentimentMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Finds named entities (currently proper names and common nouns) in the text
-     * along with entity types, salience, mentions for each entity, and
-     * other properties.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse> - analyzeEntities(com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeEntitiesMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse> - analyzeEntitySentiment( - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeEntitySentimentMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part of speech tags, dependency trees, and other
-     * properties.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse> - analyzeSyntax(com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnalyzeSyntaxMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Classifies a document into categories.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1beta2.ClassifyTextResponse> - classifyText(com.google.cloud.language.v1beta2.ClassifyTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getClassifyTextMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * A convenience method that provides all syntax, sentiment, entity, and
-     * classification features in one call.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.language.v1beta2.AnnotateTextResponse> - annotateText(com.google.cloud.language.v1beta2.AnnotateTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAnnotateTextMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_ANALYZE_SENTIMENT = 0; - private static final int METHODID_ANALYZE_ENTITIES = 1; - private static final int METHODID_ANALYZE_ENTITY_SENTIMENT = 2; - private static final int METHODID_ANALYZE_SYNTAX = 3; - private static final int METHODID_CLASSIFY_TEXT = 4; - private static final int METHODID_ANNOTATE_TEXT = 5; - - 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 LanguageServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(LanguageServiceImplBase 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_ANALYZE_SENTIMENT: - serviceImpl.analyzeSentiment( - (com.google.cloud.language.v1beta2.AnalyzeSentimentRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.language.v1beta2.AnalyzeSentimentResponse>) - responseObserver); - break; - case METHODID_ANALYZE_ENTITIES: - serviceImpl.analyzeEntities( - (com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse>) - responseObserver); - break; - case METHODID_ANALYZE_ENTITY_SENTIMENT: - serviceImpl.analyzeEntitySentiment( - (com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse>) - responseObserver); - break; - case METHODID_ANALYZE_SYNTAX: - serviceImpl.analyzeSyntax( - (com.google.cloud.language.v1beta2.AnalyzeSyntaxRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_CLASSIFY_TEXT: - serviceImpl.classifyText( - (com.google.cloud.language.v1beta2.ClassifyTextRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_ANNOTATE_TEXT: - serviceImpl.annotateText( - (com.google.cloud.language.v1beta2.AnnotateTextRequest) 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 LanguageServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - LanguageServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.language.v1beta2.LanguageServiceProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("LanguageService"); - } - } - - private static final class LanguageServiceFileDescriptorSupplier - extends LanguageServiceBaseDescriptorSupplier { - LanguageServiceFileDescriptorSupplier() {} - } - - private static final class LanguageServiceMethodDescriptorSupplier - extends LanguageServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - LanguageServiceMethodDescriptorSupplier(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 (LanguageServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new LanguageServiceFileDescriptorSupplier()) - .addMethod(getAnalyzeSentimentMethod()) - .addMethod(getAnalyzeEntitiesMethod()) - .addMethod(getAnalyzeEntitySentimentMethod()) - .addMethod(getAnalyzeSyntaxMethod()) - .addMethod(getClassifyTextMethod()) - .addMethod(getAnnotateTextMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/java.header b/java.header deleted file mode 100644 index d0970ba7..00000000 --- a/java.header +++ /dev/null @@ -1,15 +0,0 @@ -^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|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\.$ -^ \*/$ diff --git a/license-checks.xml b/license-checks.xml deleted file mode 100644 index 6597fced..00000000 --- a/license-checks.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index e80d5bca..00000000 --- a/pom.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-language-parent - pom - 2.4.2-SNAPSHOT - Google Cloud Natural Language Parent - https://github.com/googleapis/java-language - - Java idiomatic client for Google Cloud Platform services. - - - - com.google.cloud - google-cloud-shared-config - 1.5.4 - - - - - chingor - Jeff Ching - chingor@google.com - Google - - Developer - - - - - Google LLC - - - scm:git:git@github.com:googleapis/java-language.git - scm:git:git@github.com:googleapis/java-language.git - https://github.com/googleapis/java-language - HEAD - - - https://github.com/googleapis/java-language/issues - GitHub Issues - - - - - Apache-2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - - - UTF-8 - UTF-8 - github - google-cloud-language-parent - - - - - - com.google.api.grpc - proto-google-cloud-language-v1 - 2.4.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-language-v1beta2 - 0.91.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-language-v1 - 2.4.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-language-v1beta2 - 0.91.2-SNAPSHOT - - - com.google.cloud - google-cloud-language - 2.4.2-SNAPSHOT - - - - com.google.cloud - google-cloud-shared-dependencies - 3.0.5 - pom - import - - - - junit - junit - 4.13.2 - test - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - org.objenesis:objenesis - javax.annotation:javax.annotation-api - - - - - - - - - google-cloud-language - grpc-google-cloud-language-v1 - grpc-google-cloud-language-v1beta2 - proto-google-cloud-language-v1 - proto-google-cloud-language-v1beta2 - google-cloud-language-bom - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.4.1 - - - - index - dependency-info - team - ci-management - issue-management - licenses - scm - dependency-management - distribution-management - summary - modules - - - - - true - ${site.installationModule} - jar - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - html - - aggregate - javadoc - - - - - none - protected - true - ${project.build.directory}/javadoc - - - Test helpers packages - com.google.cloud.testing - - - SPI packages - com.google.cloud.spi* - - - - - https://grpc.io/grpc-java/javadoc/ - https://developers.google.com/protocol-buffers/docs/reference/java/ - https://googleapis.dev/java/google-auth-library/latest/ - https://googleapis.dev/java/gax/latest/ - https://googleapis.github.io/api-common-java/ - - - - - - diff --git a/proto-google-cloud-language-v1/clirr-ignored-differences.xml b/proto-google-cloud-language-v1/clirr-ignored-differences.xml deleted file mode 100644 index 741654f7..00000000 --- a/proto-google-cloud-language-v1/clirr-ignored-differences.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 7012 - com/google/cloud/language/v1/*OrBuilder - * get*(*) - - - 7012 - com/google/cloud/language/v1/*OrBuilder - boolean contains*(*) - - - 7012 - com/google/cloud/language/v1/*OrBuilder - boolean has*(*) - - diff --git a/proto-google-cloud-language-v1/pom.xml b/proto-google-cloud-language-v1/pom.xml deleted file mode 100644 index ad72228f..00000000 --- a/proto-google-cloud-language-v1/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-google-cloud-language-v1 - 2.4.2-SNAPSHOT - proto-google-cloud-language-v1 - PROTO library for proto-google-cloud-language-v1 - - com.google.cloud - google-cloud-language-parent - 2.4.2-SNAPSHOT - - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-common-protos - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java deleted file mode 100644 index 620d007a..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java +++ /dev/null @@ -1,877 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The entity analysis request message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitiesRequest} - */ -public final class AnalyzeEntitiesRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeEntitiesRequest) - AnalyzeEntitiesRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeEntitiesRequest.newBuilder() to construct. - private AnalyzeEntitiesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeEntitiesRequest() { - encodingType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeEntitiesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitiesRequest.class, - com.google.cloud.language.v1.AnalyzeEntitiesRequest.Builder.class); - } - - public static final int DOCUMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Document document_; - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - @java.lang.Override - public boolean hasDocument() { - return document_ != null; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - @java.lang.Override - public com.google.cloud.language.v1.Document getDocument() { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - return getDocument(); - } - - public static final int ENCODING_TYPE_FIELD_NUMBER = 2; - private int encodingType_; - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (document_ != null) { - output.writeMessage(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - output.writeEnum(2, encodingType_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (document_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeEntitiesRequest)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeEntitiesRequest other = - (com.google.cloud.language.v1.AnalyzeEntitiesRequest) obj; - - if (hasDocument() != other.hasDocument()) return false; - if (hasDocument()) { - if (!getDocument().equals(other.getDocument())) return false; - } - if (encodingType_ != other.encodingType_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocument()) { - hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocument().hashCode(); - } - hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + encodingType_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest 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.language.v1.AnalyzeEntitiesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest 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.language.v1.AnalyzeEntitiesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest 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.language.v1.AnalyzeEntitiesRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest 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.language.v1.AnalyzeEntitiesRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest 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.language.v1.AnalyzeEntitiesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The entity analysis request message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitiesRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeEntitiesRequest) - com.google.cloud.language.v1.AnalyzeEntitiesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitiesRequest.class, - com.google.cloud.language.v1.AnalyzeEntitiesRequest.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeEntitiesRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentBuilder_ == null) { - document_ = null; - } else { - document_ = null; - documentBuilder_ = null; - } - encodingType_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesRequest getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeEntitiesRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesRequest build() { - com.google.cloud.language.v1.AnalyzeEntitiesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesRequest buildPartial() { - com.google.cloud.language.v1.AnalyzeEntitiesRequest result = - new com.google.cloud.language.v1.AnalyzeEntitiesRequest(this); - if (documentBuilder_ == null) { - result.document_ = document_; - } else { - result.document_ = documentBuilder_.build(); - } - result.encodingType_ = encodingType_; - 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.language.v1.AnalyzeEntitiesRequest) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeEntitiesRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitiesRequest other) { - if (other == com.google.cloud.language.v1.AnalyzeEntitiesRequest.getDefaultInstance()) - return this; - if (other.hasDocument()) { - mergeDocument(other.getDocument()); - } - if (other.encodingType_ != 0) { - setEncodingTypeValue(other.getEncodingTypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 16: - { - encodingType_ = input.readEnum(); - - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private com.google.cloud.language.v1.Document document_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - documentBuilder_; - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - public boolean hasDocument() { - return documentBuilder_ != null || document_ != null; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - public com.google.cloud.language.v1.Document getDocument() { - if (documentBuilder_ == null) { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } else { - return documentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - document_ = value; - onChanged(); - } else { - documentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { - if (documentBuilder_ == null) { - document_ = builderForValue.build(); - onChanged(); - } else { - documentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (document_ != null) { - document_ = - com.google.cloud.language.v1.Document.newBuilder(document_) - .mergeFrom(value) - .buildPartial(); - } else { - document_ = value; - } - onChanged(); - } else { - documentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDocument() { - if (documentBuilder_ == null) { - document_ = null; - onChanged(); - } else { - document_ = null; - documentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { - - onChanged(); - return getDocumentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - if (documentBuilder_ != null) { - return documentBuilder_.getMessageOrBuilder(); - } else { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - getDocumentFieldBuilder() { - if (documentBuilder_ == null) { - documentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder>( - getDocument(), getParentForChildren(), isClean()); - document_ = null; - } - return documentBuilder_; - } - - private int encodingType_ = 0; - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The enum numeric value on the wire for encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingTypeValue(int value) { - - encodingType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingType(com.google.cloud.language.v1.EncodingType value) { - if (value == null) { - throw new NullPointerException(); - } - - encodingType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return This builder for chaining. - */ - public Builder clearEncodingType() { - - encodingType_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnalyzeEntitiesRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeEntitiesRequest) - private static final com.google.cloud.language.v1.AnalyzeEntitiesRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeEntitiesRequest(); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeEntitiesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java deleted file mode 100644 index 2b0136d7..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeEntitiesRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeEntitiesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - boolean hasDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - com.google.cloud.language.v1.Document getDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); - - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - int getEncodingTypeValue(); - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - com.google.cloud.language.v1.EncodingType getEncodingType(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java deleted file mode 100644 index 2b668265..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java +++ /dev/null @@ -1,1117 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The entity analysis response message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitiesResponse} - */ -public final class AnalyzeEntitiesResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeEntitiesResponse) - AnalyzeEntitiesResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeEntitiesResponse.newBuilder() to construct. - private AnalyzeEntitiesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeEntitiesResponse() { - entities_ = java.util.Collections.emptyList(); - language_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeEntitiesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitiesResponse.class, - com.google.cloud.language.v1.AnalyzeEntitiesResponse.Builder.class); - } - - public static final int ENTITIES_FIELD_NUMBER = 1; - private java.util.List entities_; - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public java.util.List getEntitiesList() { - return entities_; - } - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public java.util.List - getEntitiesOrBuilderList() { - return entities_; - } - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public int getEntitiesCount() { - return entities_.size(); - } - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.Entity getEntities(int index) { - return entities_.get(index); - } - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index) { - return entities_.get(index); - } - - public static final int LANGUAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object language_; - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The language. - */ - @java.lang.Override - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - 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(); - language_ = s; - return s; - } - } - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = 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 < entities_.size(); i++) { - output.writeMessage(1, entities_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < entities_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entities_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeEntitiesResponse)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeEntitiesResponse other = - (com.google.cloud.language.v1.AnalyzeEntitiesResponse) obj; - - if (!getEntitiesList().equals(other.getEntitiesList())) return false; - if (!getLanguage().equals(other.getLanguage())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEntitiesCount() > 0) { - hash = (37 * hash) + ENTITIES_FIELD_NUMBER; - hash = (53 * hash) + getEntitiesList().hashCode(); - } - hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse 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.language.v1.AnalyzeEntitiesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse 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.language.v1.AnalyzeEntitiesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse 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.language.v1.AnalyzeEntitiesResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse 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.language.v1.AnalyzeEntitiesResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse 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.language.v1.AnalyzeEntitiesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The entity analysis response message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitiesResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeEntitiesResponse) - com.google.cloud.language.v1.AnalyzeEntitiesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitiesResponse.class, - com.google.cloud.language.v1.AnalyzeEntitiesResponse.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeEntitiesResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (entitiesBuilder_ == null) { - entities_ = java.util.Collections.emptyList(); - } else { - entities_ = null; - entitiesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - language_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesResponse getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeEntitiesResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesResponse build() { - com.google.cloud.language.v1.AnalyzeEntitiesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesResponse buildPartial() { - com.google.cloud.language.v1.AnalyzeEntitiesResponse result = - new com.google.cloud.language.v1.AnalyzeEntitiesResponse(this); - int from_bitField0_ = bitField0_; - if (entitiesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.entities_ = entities_; - } else { - result.entities_ = entitiesBuilder_.build(); - } - result.language_ = language_; - 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.language.v1.AnalyzeEntitiesResponse) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeEntitiesResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitiesResponse other) { - if (other == com.google.cloud.language.v1.AnalyzeEntitiesResponse.getDefaultInstance()) - return this; - if (entitiesBuilder_ == null) { - if (!other.entities_.isEmpty()) { - if (entities_.isEmpty()) { - entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEntitiesIsMutable(); - entities_.addAll(other.entities_); - } - onChanged(); - } - } else { - if (!other.entities_.isEmpty()) { - if (entitiesBuilder_.isEmpty()) { - entitiesBuilder_.dispose(); - entitiesBuilder_ = null; - entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000001); - entitiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEntitiesFieldBuilder() - : null; - } else { - entitiesBuilder_.addAllMessages(other.entities_); - } - } - } - if (!other.getLanguage().isEmpty()) { - language_ = other.language_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Entity m = - input.readMessage( - com.google.cloud.language.v1.Entity.parser(), extensionRegistry); - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(m); - } else { - entitiesBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - language_ = input.readStringRequireUtf8(); - - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List entities_ = - java.util.Collections.emptyList(); - - private void ensureEntitiesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - entities_ = new java.util.ArrayList(entities_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder> - entitiesBuilder_; - - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public java.util.List getEntitiesList() { - if (entitiesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entities_); - } else { - return entitiesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public int getEntitiesCount() { - if (entitiesBuilder_ == null) { - return entities_.size(); - } else { - return entitiesBuilder_.getCount(); - } - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity getEntities(int index) { - if (entitiesBuilder_ == null) { - return entities_.get(index); - } else { - return entitiesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder setEntities(int index, com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.set(index, value); - onChanged(); - } else { - entitiesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder setEntities( - int index, com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.set(index, builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities(com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.add(value); - onChanged(); - } else { - entitiesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities(int index, com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.add(index, value); - onChanged(); - } else { - entitiesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities(com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities( - int index, com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(index, builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addAllEntities( - java.lang.Iterable values) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entities_); - onChanged(); - } else { - entitiesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder clearEntities() { - if (entitiesBuilder_ == null) { - entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - entitiesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder removeEntities(int index) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.remove(index); - onChanged(); - } else { - entitiesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity.Builder getEntitiesBuilder(int index) { - return getEntitiesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index) { - if (entitiesBuilder_ == null) { - return entities_.get(index); - } else { - return entitiesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public java.util.List - getEntitiesOrBuilderList() { - if (entitiesBuilder_ != null) { - return entitiesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entities_); - } - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity.Builder addEntitiesBuilder() { - return getEntitiesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Entity.getDefaultInstance()); - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity.Builder addEntitiesBuilder(int index) { - return getEntitiesFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Entity.getDefaultInstance()); - } - /** - * - * - *
-     * The recognized entities in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public java.util.List getEntitiesBuilderList() { - return getEntitiesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder> - getEntitiesFieldBuilder() { - if (entitiesBuilder_ == null) { - entitiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder>( - entities_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - entities_ = null; - } - return entitiesBuilder_; - } - - private java.lang.Object language_ = ""; - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return The language. - */ - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - language_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @param value The language to set. - * @return This builder for chaining. - */ - public Builder setLanguage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - language_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return This builder for chaining. - */ - public Builder clearLanguage() { - - language_ = getDefaultInstance().getLanguage(); - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @param value The bytes for language to set. - * @return This builder for chaining. - */ - public Builder setLanguageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - language_ = 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.language.v1.AnalyzeEntitiesResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeEntitiesResponse) - private static final com.google.cloud.language.v1.AnalyzeEntitiesResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeEntitiesResponse(); - } - - public static com.google.cloud.language.v1.AnalyzeEntitiesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeEntitiesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitiesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java deleted file mode 100644 index 62bb035b..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeEntitiesResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeEntitiesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - java.util.List getEntitiesList(); - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - com.google.cloud.language.v1.Entity getEntities(int index); - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - int getEntitiesCount(); - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - java.util.List getEntitiesOrBuilderList(); - /** - * - * - *
-   * The recognized entities in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index); - - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The language. - */ - java.lang.String getLanguage(); - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - com.google.protobuf.ByteString getLanguageBytes(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java deleted file mode 100644 index 7c2e7f06..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java +++ /dev/null @@ -1,878 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The entity-level sentiment analysis request message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitySentimentRequest} - */ -public final class AnalyzeEntitySentimentRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeEntitySentimentRequest) - AnalyzeEntitySentimentRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeEntitySentimentRequest.newBuilder() to construct. - private AnalyzeEntitySentimentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeEntitySentimentRequest() { - encodingType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeEntitySentimentRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.class, - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.Builder.class); - } - - public static final int DOCUMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Document document_; - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - @java.lang.Override - public boolean hasDocument() { - return document_ != null; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - @java.lang.Override - public com.google.cloud.language.v1.Document getDocument() { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - return getDocument(); - } - - public static final int ENCODING_TYPE_FIELD_NUMBER = 2; - private int encodingType_; - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (document_ != null) { - output.writeMessage(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - output.writeEnum(2, encodingType_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (document_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeEntitySentimentRequest)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest other = - (com.google.cloud.language.v1.AnalyzeEntitySentimentRequest) obj; - - if (hasDocument() != other.hasDocument()) return false; - if (hasDocument()) { - if (!getDocument().equals(other.getDocument())) return false; - } - if (encodingType_ != other.encodingType_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocument()) { - hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocument().hashCode(); - } - hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + encodingType_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest 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.language.v1.AnalyzeEntitySentimentRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest 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.language.v1.AnalyzeEntitySentimentRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest 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.language.v1.AnalyzeEntitySentimentRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest 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.language.v1.AnalyzeEntitySentimentRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest 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.language.v1.AnalyzeEntitySentimentRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The entity-level sentiment analysis request message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitySentimentRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeEntitySentimentRequest) - com.google.cloud.language.v1.AnalyzeEntitySentimentRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.class, - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentBuilder_ == null) { - document_ = null; - } else { - document_ = null; - documentBuilder_ = null; - } - encodingType_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentRequest getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentRequest build() { - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentRequest buildPartial() { - com.google.cloud.language.v1.AnalyzeEntitySentimentRequest result = - new com.google.cloud.language.v1.AnalyzeEntitySentimentRequest(this); - if (documentBuilder_ == null) { - result.document_ = document_; - } else { - result.document_ = documentBuilder_.build(); - } - result.encodingType_ = encodingType_; - 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.language.v1.AnalyzeEntitySentimentRequest) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeEntitySentimentRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitySentimentRequest other) { - if (other == com.google.cloud.language.v1.AnalyzeEntitySentimentRequest.getDefaultInstance()) - return this; - if (other.hasDocument()) { - mergeDocument(other.getDocument()); - } - if (other.encodingType_ != 0) { - setEncodingTypeValue(other.getEncodingTypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 16: - { - encodingType_ = input.readEnum(); - - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private com.google.cloud.language.v1.Document document_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - documentBuilder_; - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - public boolean hasDocument() { - return documentBuilder_ != null || document_ != null; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - public com.google.cloud.language.v1.Document getDocument() { - if (documentBuilder_ == null) { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } else { - return documentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - document_ = value; - onChanged(); - } else { - documentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { - if (documentBuilder_ == null) { - document_ = builderForValue.build(); - onChanged(); - } else { - documentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (document_ != null) { - document_ = - com.google.cloud.language.v1.Document.newBuilder(document_) - .mergeFrom(value) - .buildPartial(); - } else { - document_ = value; - } - onChanged(); - } else { - documentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDocument() { - if (documentBuilder_ == null) { - document_ = null; - onChanged(); - } else { - document_ = null; - documentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { - - onChanged(); - return getDocumentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - if (documentBuilder_ != null) { - return documentBuilder_.getMessageOrBuilder(); - } else { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - getDocumentFieldBuilder() { - if (documentBuilder_ == null) { - documentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder>( - getDocument(), getParentForChildren(), isClean()); - document_ = null; - } - return documentBuilder_; - } - - private int encodingType_ = 0; - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The enum numeric value on the wire for encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingTypeValue(int value) { - - encodingType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingType(com.google.cloud.language.v1.EncodingType value) { - if (value == null) { - throw new NullPointerException(); - } - - encodingType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return This builder for chaining. - */ - public Builder clearEncodingType() { - - encodingType_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnalyzeEntitySentimentRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeEntitySentimentRequest) - private static final com.google.cloud.language.v1.AnalyzeEntitySentimentRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeEntitySentimentRequest(); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeEntitySentimentRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java deleted file mode 100644 index 9001f8b5..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeEntitySentimentRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeEntitySentimentRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - boolean hasDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - com.google.cloud.language.v1.Document getDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); - - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - int getEncodingTypeValue(); - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - com.google.cloud.language.v1.EncodingType getEncodingType(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java deleted file mode 100644 index 70859072..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java +++ /dev/null @@ -1,1119 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The entity-level sentiment analysis response message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitySentimentResponse} - */ -public final class AnalyzeEntitySentimentResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeEntitySentimentResponse) - AnalyzeEntitySentimentResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeEntitySentimentResponse.newBuilder() to construct. - private AnalyzeEntitySentimentResponse( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeEntitySentimentResponse() { - entities_ = java.util.Collections.emptyList(); - language_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeEntitySentimentResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.class, - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.Builder.class); - } - - public static final int ENTITIES_FIELD_NUMBER = 1; - private java.util.List entities_; - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public java.util.List getEntitiesList() { - return entities_; - } - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public java.util.List - getEntitiesOrBuilderList() { - return entities_; - } - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public int getEntitiesCount() { - return entities_.size(); - } - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.Entity getEntities(int index) { - return entities_.get(index); - } - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index) { - return entities_.get(index); - } - - public static final int LANGUAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object language_; - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The language. - */ - @java.lang.Override - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - 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(); - language_ = s; - return s; - } - } - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = 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 < entities_.size(); i++) { - output.writeMessage(1, entities_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < entities_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entities_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeEntitySentimentResponse)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse other = - (com.google.cloud.language.v1.AnalyzeEntitySentimentResponse) obj; - - if (!getEntitiesList().equals(other.getEntitiesList())) return false; - if (!getLanguage().equals(other.getLanguage())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEntitiesCount() > 0) { - hash = (37 * hash) + ENTITIES_FIELD_NUMBER; - hash = (53 * hash) + getEntitiesList().hashCode(); - } - hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse 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.language.v1.AnalyzeEntitySentimentResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse 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.language.v1.AnalyzeEntitySentimentResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse 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.language.v1.AnalyzeEntitySentimentResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse 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.language.v1.AnalyzeEntitySentimentResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse 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.language.v1.AnalyzeEntitySentimentResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The entity-level sentiment analysis response message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeEntitySentimentResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeEntitySentimentResponse) - com.google.cloud.language.v1.AnalyzeEntitySentimentResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.class, - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (entitiesBuilder_ == null) { - entities_ = java.util.Collections.emptyList(); - } else { - entities_ = null; - entitiesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - language_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse build() { - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse buildPartial() { - com.google.cloud.language.v1.AnalyzeEntitySentimentResponse result = - new com.google.cloud.language.v1.AnalyzeEntitySentimentResponse(this); - int from_bitField0_ = bitField0_; - if (entitiesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.entities_ = entities_; - } else { - result.entities_ = entitiesBuilder_.build(); - } - result.language_ = language_; - 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.language.v1.AnalyzeEntitySentimentResponse) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeEntitySentimentResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitySentimentResponse other) { - if (other == com.google.cloud.language.v1.AnalyzeEntitySentimentResponse.getDefaultInstance()) - return this; - if (entitiesBuilder_ == null) { - if (!other.entities_.isEmpty()) { - if (entities_.isEmpty()) { - entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEntitiesIsMutable(); - entities_.addAll(other.entities_); - } - onChanged(); - } - } else { - if (!other.entities_.isEmpty()) { - if (entitiesBuilder_.isEmpty()) { - entitiesBuilder_.dispose(); - entitiesBuilder_ = null; - entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000001); - entitiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEntitiesFieldBuilder() - : null; - } else { - entitiesBuilder_.addAllMessages(other.entities_); - } - } - } - if (!other.getLanguage().isEmpty()) { - language_ = other.language_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Entity m = - input.readMessage( - com.google.cloud.language.v1.Entity.parser(), extensionRegistry); - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(m); - } else { - entitiesBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - language_ = input.readStringRequireUtf8(); - - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List entities_ = - java.util.Collections.emptyList(); - - private void ensureEntitiesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - entities_ = new java.util.ArrayList(entities_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder> - entitiesBuilder_; - - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public java.util.List getEntitiesList() { - if (entitiesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entities_); - } else { - return entitiesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public int getEntitiesCount() { - if (entitiesBuilder_ == null) { - return entities_.size(); - } else { - return entitiesBuilder_.getCount(); - } - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity getEntities(int index) { - if (entitiesBuilder_ == null) { - return entities_.get(index); - } else { - return entitiesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder setEntities(int index, com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.set(index, value); - onChanged(); - } else { - entitiesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder setEntities( - int index, com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.set(index, builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities(com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.add(value); - onChanged(); - } else { - entitiesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities(int index, com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.add(index, value); - onChanged(); - } else { - entitiesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities(com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addEntities( - int index, com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(index, builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder addAllEntities( - java.lang.Iterable values) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entities_); - onChanged(); - } else { - entitiesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder clearEntities() { - if (entitiesBuilder_ == null) { - entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - entitiesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public Builder removeEntities(int index) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.remove(index); - onChanged(); - } else { - entitiesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity.Builder getEntitiesBuilder(int index) { - return getEntitiesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index) { - if (entitiesBuilder_ == null) { - return entities_.get(index); - } else { - return entitiesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public java.util.List - getEntitiesOrBuilderList() { - if (entitiesBuilder_ != null) { - return entitiesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entities_); - } - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity.Builder addEntitiesBuilder() { - return getEntitiesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Entity.getDefaultInstance()); - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public com.google.cloud.language.v1.Entity.Builder addEntitiesBuilder(int index) { - return getEntitiesFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Entity.getDefaultInstance()); - } - /** - * - * - *
-     * The recognized entities in the input document with associated sentiments.
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - public java.util.List getEntitiesBuilderList() { - return getEntitiesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder> - getEntitiesFieldBuilder() { - if (entitiesBuilder_ == null) { - entitiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder>( - entities_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - entities_ = null; - } - return entitiesBuilder_; - } - - private java.lang.Object language_ = ""; - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return The language. - */ - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - language_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @param value The language to set. - * @return This builder for chaining. - */ - public Builder setLanguage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - language_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return This builder for chaining. - */ - public Builder clearLanguage() { - - language_ = getDefaultInstance().getLanguage(); - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @param value The bytes for language to set. - * @return This builder for chaining. - */ - public Builder setLanguageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - language_ = 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.language.v1.AnalyzeEntitySentimentResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeEntitySentimentResponse) - private static final com.google.cloud.language.v1.AnalyzeEntitySentimentResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeEntitySentimentResponse(); - } - - public static com.google.cloud.language.v1.AnalyzeEntitySentimentResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeEntitySentimentResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java deleted file mode 100644 index 16ee973a..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeEntitySentimentResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeEntitySentimentResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - java.util.List getEntitiesList(); - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - com.google.cloud.language.v1.Entity getEntities(int index); - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - int getEntitiesCount(); - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - java.util.List getEntitiesOrBuilderList(); - /** - * - * - *
-   * The recognized entities in the input document with associated sentiments.
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 1; - */ - com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index); - - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The language. - */ - java.lang.String getLanguage(); - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - com.google.protobuf.ByteString getLanguageBytes(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java deleted file mode 100644 index f3a5f9f7..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java +++ /dev/null @@ -1,877 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The sentiment analysis request message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSentimentRequest} - */ -public final class AnalyzeSentimentRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeSentimentRequest) - AnalyzeSentimentRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeSentimentRequest.newBuilder() to construct. - private AnalyzeSentimentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeSentimentRequest() { - encodingType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeSentimentRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSentimentRequest.class, - com.google.cloud.language.v1.AnalyzeSentimentRequest.Builder.class); - } - - public static final int DOCUMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Document document_; - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - @java.lang.Override - public boolean hasDocument() { - return document_ != null; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - @java.lang.Override - public com.google.cloud.language.v1.Document getDocument() { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - return getDocument(); - } - - public static final int ENCODING_TYPE_FIELD_NUMBER = 2; - private int encodingType_; - /** - * - * - *
-   * The encoding type used by the API to calculate sentence offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-   * The encoding type used by the API to calculate sentence offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (document_ != null) { - output.writeMessage(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - output.writeEnum(2, encodingType_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (document_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeSentimentRequest)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeSentimentRequest other = - (com.google.cloud.language.v1.AnalyzeSentimentRequest) obj; - - if (hasDocument() != other.hasDocument()) return false; - if (hasDocument()) { - if (!getDocument().equals(other.getDocument())) return false; - } - if (encodingType_ != other.encodingType_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocument()) { - hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocument().hashCode(); - } - hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + encodingType_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest 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.language.v1.AnalyzeSentimentRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest 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.language.v1.AnalyzeSentimentRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest 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.language.v1.AnalyzeSentimentRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest 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.language.v1.AnalyzeSentimentRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest 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.language.v1.AnalyzeSentimentRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The sentiment analysis request message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSentimentRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeSentimentRequest) - com.google.cloud.language.v1.AnalyzeSentimentRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSentimentRequest.class, - com.google.cloud.language.v1.AnalyzeSentimentRequest.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeSentimentRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentBuilder_ == null) { - document_ = null; - } else { - document_ = null; - documentBuilder_ = null; - } - encodingType_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentRequest getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeSentimentRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentRequest build() { - com.google.cloud.language.v1.AnalyzeSentimentRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentRequest buildPartial() { - com.google.cloud.language.v1.AnalyzeSentimentRequest result = - new com.google.cloud.language.v1.AnalyzeSentimentRequest(this); - if (documentBuilder_ == null) { - result.document_ = document_; - } else { - result.document_ = documentBuilder_.build(); - } - result.encodingType_ = encodingType_; - 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.language.v1.AnalyzeSentimentRequest) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeSentimentRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSentimentRequest other) { - if (other == com.google.cloud.language.v1.AnalyzeSentimentRequest.getDefaultInstance()) - return this; - if (other.hasDocument()) { - mergeDocument(other.getDocument()); - } - if (other.encodingType_ != 0) { - setEncodingTypeValue(other.getEncodingTypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 16: - { - encodingType_ = input.readEnum(); - - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private com.google.cloud.language.v1.Document document_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - documentBuilder_; - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - public boolean hasDocument() { - return documentBuilder_ != null || document_ != null; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - public com.google.cloud.language.v1.Document getDocument() { - if (documentBuilder_ == null) { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } else { - return documentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - document_ = value; - onChanged(); - } else { - documentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { - if (documentBuilder_ == null) { - document_ = builderForValue.build(); - onChanged(); - } else { - documentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (document_ != null) { - document_ = - com.google.cloud.language.v1.Document.newBuilder(document_) - .mergeFrom(value) - .buildPartial(); - } else { - document_ = value; - } - onChanged(); - } else { - documentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDocument() { - if (documentBuilder_ == null) { - document_ = null; - onChanged(); - } else { - document_ = null; - documentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { - - onChanged(); - return getDocumentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - if (documentBuilder_ != null) { - return documentBuilder_.getMessageOrBuilder(); - } else { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - getDocumentFieldBuilder() { - if (documentBuilder_ == null) { - documentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder>( - getDocument(), getParentForChildren(), isClean()); - document_ = null; - } - return documentBuilder_; - } - - private int encodingType_ = 0; - /** - * - * - *
-     * The encoding type used by the API to calculate sentence offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-     * The encoding type used by the API to calculate sentence offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The enum numeric value on the wire for encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingTypeValue(int value) { - - encodingType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate sentence offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - /** - * - * - *
-     * The encoding type used by the API to calculate sentence offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingType(com.google.cloud.language.v1.EncodingType value) { - if (value == null) { - throw new NullPointerException(); - } - - encodingType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate sentence offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return This builder for chaining. - */ - public Builder clearEncodingType() { - - encodingType_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnalyzeSentimentRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeSentimentRequest) - private static final com.google.cloud.language.v1.AnalyzeSentimentRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeSentimentRequest(); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeSentimentRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java deleted file mode 100644 index 10852b5c..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeSentimentRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeSentimentRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - boolean hasDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - com.google.cloud.language.v1.Document getDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); - - /** - * - * - *
-   * The encoding type used by the API to calculate sentence offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - int getEncodingTypeValue(); - /** - * - * - *
-   * The encoding type used by the API to calculate sentence offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - com.google.cloud.language.v1.EncodingType getEncodingType(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java deleted file mode 100644 index be629c99..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java +++ /dev/null @@ -1,1387 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The sentiment analysis response message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSentimentResponse} - */ -public final class AnalyzeSentimentResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeSentimentResponse) - AnalyzeSentimentResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeSentimentResponse.newBuilder() to construct. - private AnalyzeSentimentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeSentimentResponse() { - language_ = ""; - sentences_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeSentimentResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSentimentResponse.class, - com.google.cloud.language.v1.AnalyzeSentimentResponse.Builder.class); - } - - public static final int DOCUMENT_SENTIMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Sentiment documentSentiment_; - /** - * - * - *
-   * The overall sentiment of the input document.
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - * - * @return Whether the documentSentiment field is set. - */ - @java.lang.Override - public boolean hasDocumentSentiment() { - return documentSentiment_ != null; - } - /** - * - * - *
-   * The overall sentiment of the input document.
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - * - * @return The documentSentiment. - */ - @java.lang.Override - public com.google.cloud.language.v1.Sentiment getDocumentSentiment() { - return documentSentiment_ == null - ? com.google.cloud.language.v1.Sentiment.getDefaultInstance() - : documentSentiment_; - } - /** - * - * - *
-   * The overall sentiment of the input document.
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBuilder() { - return getDocumentSentiment(); - } - - public static final int LANGUAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object language_; - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The language. - */ - @java.lang.Override - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - 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(); - language_ = s; - return s; - } - } - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENTENCES_FIELD_NUMBER = 3; - private java.util.List sentences_; - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - @java.lang.Override - public java.util.List getSentencesList() { - return sentences_; - } - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - @java.lang.Override - public java.util.List - getSentencesOrBuilderList() { - return sentences_; - } - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - @java.lang.Override - public int getSentencesCount() { - return sentences_.size(); - } - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - @java.lang.Override - public com.google.cloud.language.v1.Sentence getSentences(int index) { - return sentences_.get(index); - } - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - @java.lang.Override - public com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index) { - return sentences_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (documentSentiment_ != null) { - output.writeMessage(1, getDocumentSentiment()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, language_); - } - for (int i = 0; i < sentences_.size(); i++) { - output.writeMessage(3, sentences_.get(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (documentSentiment_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocumentSentiment()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, language_); - } - for (int i = 0; i < sentences_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, sentences_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeSentimentResponse)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeSentimentResponse other = - (com.google.cloud.language.v1.AnalyzeSentimentResponse) obj; - - if (hasDocumentSentiment() != other.hasDocumentSentiment()) return false; - if (hasDocumentSentiment()) { - if (!getDocumentSentiment().equals(other.getDocumentSentiment())) return false; - } - if (!getLanguage().equals(other.getLanguage())) return false; - if (!getSentencesList().equals(other.getSentencesList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocumentSentiment()) { - hash = (37 * hash) + DOCUMENT_SENTIMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocumentSentiment().hashCode(); - } - hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getLanguage().hashCode(); - if (getSentencesCount() > 0) { - hash = (37 * hash) + SENTENCES_FIELD_NUMBER; - hash = (53 * hash) + getSentencesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse 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.language.v1.AnalyzeSentimentResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse 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.language.v1.AnalyzeSentimentResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse 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.language.v1.AnalyzeSentimentResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse 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.language.v1.AnalyzeSentimentResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse 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.language.v1.AnalyzeSentimentResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The sentiment analysis response message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSentimentResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeSentimentResponse) - com.google.cloud.language.v1.AnalyzeSentimentResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSentimentResponse.class, - com.google.cloud.language.v1.AnalyzeSentimentResponse.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeSentimentResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentSentimentBuilder_ == null) { - documentSentiment_ = null; - } else { - documentSentiment_ = null; - documentSentimentBuilder_ = null; - } - language_ = ""; - - if (sentencesBuilder_ == null) { - sentences_ = java.util.Collections.emptyList(); - } else { - sentences_ = null; - sentencesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentResponse getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeSentimentResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentResponse build() { - com.google.cloud.language.v1.AnalyzeSentimentResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentResponse buildPartial() { - com.google.cloud.language.v1.AnalyzeSentimentResponse result = - new com.google.cloud.language.v1.AnalyzeSentimentResponse(this); - int from_bitField0_ = bitField0_; - if (documentSentimentBuilder_ == null) { - result.documentSentiment_ = documentSentiment_; - } else { - result.documentSentiment_ = documentSentimentBuilder_.build(); - } - result.language_ = language_; - if (sentencesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sentences_ = sentences_; - } else { - result.sentences_ = sentencesBuilder_.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.language.v1.AnalyzeSentimentResponse) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeSentimentResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSentimentResponse other) { - if (other == com.google.cloud.language.v1.AnalyzeSentimentResponse.getDefaultInstance()) - return this; - if (other.hasDocumentSentiment()) { - mergeDocumentSentiment(other.getDocumentSentiment()); - } - if (!other.getLanguage().isEmpty()) { - language_ = other.language_; - onChanged(); - } - if (sentencesBuilder_ == null) { - if (!other.sentences_.isEmpty()) { - if (sentences_.isEmpty()) { - sentences_ = other.sentences_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSentencesIsMutable(); - sentences_.addAll(other.sentences_); - } - onChanged(); - } - } else { - if (!other.sentences_.isEmpty()) { - if (sentencesBuilder_.isEmpty()) { - sentencesBuilder_.dispose(); - sentencesBuilder_ = null; - sentences_ = other.sentences_; - bitField0_ = (bitField0_ & ~0x00000001); - sentencesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSentencesFieldBuilder() - : null; - } else { - sentencesBuilder_.addAllMessages(other.sentences_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage( - getDocumentSentimentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 18: - { - language_ = input.readStringRequireUtf8(); - - break; - } // case 18 - case 26: - { - com.google.cloud.language.v1.Sentence m = - input.readMessage( - com.google.cloud.language.v1.Sentence.parser(), extensionRegistry); - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(m); - } else { - sentencesBuilder_.addMessage(m); - } - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.cloud.language.v1.Sentiment documentSentiment_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Sentiment, - com.google.cloud.language.v1.Sentiment.Builder, - com.google.cloud.language.v1.SentimentOrBuilder> - documentSentimentBuilder_; - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - * - * @return Whether the documentSentiment field is set. - */ - public boolean hasDocumentSentiment() { - return documentSentimentBuilder_ != null || documentSentiment_ != null; - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - * - * @return The documentSentiment. - */ - public com.google.cloud.language.v1.Sentiment getDocumentSentiment() { - if (documentSentimentBuilder_ == null) { - return documentSentiment_ == null - ? com.google.cloud.language.v1.Sentiment.getDefaultInstance() - : documentSentiment_; - } else { - return documentSentimentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - public Builder setDocumentSentiment(com.google.cloud.language.v1.Sentiment value) { - if (documentSentimentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - documentSentiment_ = value; - onChanged(); - } else { - documentSentimentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - public Builder setDocumentSentiment( - com.google.cloud.language.v1.Sentiment.Builder builderForValue) { - if (documentSentimentBuilder_ == null) { - documentSentiment_ = builderForValue.build(); - onChanged(); - } else { - documentSentimentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - public Builder mergeDocumentSentiment(com.google.cloud.language.v1.Sentiment value) { - if (documentSentimentBuilder_ == null) { - if (documentSentiment_ != null) { - documentSentiment_ = - com.google.cloud.language.v1.Sentiment.newBuilder(documentSentiment_) - .mergeFrom(value) - .buildPartial(); - } else { - documentSentiment_ = value; - } - onChanged(); - } else { - documentSentimentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - public Builder clearDocumentSentiment() { - if (documentSentimentBuilder_ == null) { - documentSentiment_ = null; - onChanged(); - } else { - documentSentiment_ = null; - documentSentimentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - public com.google.cloud.language.v1.Sentiment.Builder getDocumentSentimentBuilder() { - - onChanged(); - return getDocumentSentimentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBuilder() { - if (documentSentimentBuilder_ != null) { - return documentSentimentBuilder_.getMessageOrBuilder(); - } else { - return documentSentiment_ == null - ? com.google.cloud.language.v1.Sentiment.getDefaultInstance() - : documentSentiment_; - } - } - /** - * - * - *
-     * The overall sentiment of the input document.
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Sentiment, - com.google.cloud.language.v1.Sentiment.Builder, - com.google.cloud.language.v1.SentimentOrBuilder> - getDocumentSentimentFieldBuilder() { - if (documentSentimentBuilder_ == null) { - documentSentimentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Sentiment, - com.google.cloud.language.v1.Sentiment.Builder, - com.google.cloud.language.v1.SentimentOrBuilder>( - getDocumentSentiment(), getParentForChildren(), isClean()); - documentSentiment_ = null; - } - return documentSentimentBuilder_; - } - - private java.lang.Object language_ = ""; - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return The language. - */ - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - language_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @param value The language to set. - * @return This builder for chaining. - */ - public Builder setLanguage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - language_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @return This builder for chaining. - */ - public Builder clearLanguage() { - - language_ = getDefaultInstance().getLanguage(); - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 2; - * - * @param value The bytes for language to set. - * @return This builder for chaining. - */ - public Builder setLanguageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - language_ = value; - onChanged(); - return this; - } - - private java.util.List sentences_ = - java.util.Collections.emptyList(); - - private void ensureSentencesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - sentences_ = new java.util.ArrayList(sentences_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder> - sentencesBuilder_; - - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public java.util.List getSentencesList() { - if (sentencesBuilder_ == null) { - return java.util.Collections.unmodifiableList(sentences_); - } else { - return sentencesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public int getSentencesCount() { - if (sentencesBuilder_ == null) { - return sentences_.size(); - } else { - return sentencesBuilder_.getCount(); - } - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public com.google.cloud.language.v1.Sentence getSentences(int index) { - if (sentencesBuilder_ == null) { - return sentences_.get(index); - } else { - return sentencesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder setSentences(int index, com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.set(index, value); - onChanged(); - } else { - sentencesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder setSentences( - int index, com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.set(index, builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder addSentences(com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.add(value); - onChanged(); - } else { - sentencesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder addSentences(int index, com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.add(index, value); - onChanged(); - } else { - sentencesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder addSentences(com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder addSentences( - int index, com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(index, builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder addAllSentences( - java.lang.Iterable values) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sentences_); - onChanged(); - } else { - sentencesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder clearSentences() { - if (sentencesBuilder_ == null) { - sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sentencesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public Builder removeSentences(int index) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.remove(index); - onChanged(); - } else { - sentencesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public com.google.cloud.language.v1.Sentence.Builder getSentencesBuilder(int index) { - return getSentencesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index) { - if (sentencesBuilder_ == null) { - return sentences_.get(index); - } else { - return sentencesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public java.util.List - getSentencesOrBuilderList() { - if (sentencesBuilder_ != null) { - return sentencesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sentences_); - } - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public com.google.cloud.language.v1.Sentence.Builder addSentencesBuilder() { - return getSentencesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Sentence.getDefaultInstance()); - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public com.google.cloud.language.v1.Sentence.Builder addSentencesBuilder(int index) { - return getSentencesFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Sentence.getDefaultInstance()); - } - /** - * - * - *
-     * The sentiment for all the sentences in the document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - public java.util.List getSentencesBuilderList() { - return getSentencesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder> - getSentencesFieldBuilder() { - if (sentencesBuilder_ == null) { - sentencesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder>( - sentences_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - sentences_ = null; - } - return sentencesBuilder_; - } - - @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.language.v1.AnalyzeSentimentResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeSentimentResponse) - private static final com.google.cloud.language.v1.AnalyzeSentimentResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeSentimentResponse(); - } - - public static com.google.cloud.language.v1.AnalyzeSentimentResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeSentimentResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSentimentResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java deleted file mode 100644 index 9fa9e608..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeSentimentResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeSentimentResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The overall sentiment of the input document.
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - * - * @return Whether the documentSentiment field is set. - */ - boolean hasDocumentSentiment(); - /** - * - * - *
-   * The overall sentiment of the input document.
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - * - * @return The documentSentiment. - */ - com.google.cloud.language.v1.Sentiment getDocumentSentiment(); - /** - * - * - *
-   * The overall sentiment of the input document.
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 1; - */ - com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBuilder(); - - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The language. - */ - java.lang.String getLanguage(); - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 2; - * - * @return The bytes for language. - */ - com.google.protobuf.ByteString getLanguageBytes(); - - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - java.util.List getSentencesList(); - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - com.google.cloud.language.v1.Sentence getSentences(int index); - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - int getSentencesCount(); - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - java.util.List - getSentencesOrBuilderList(); - /** - * - * - *
-   * The sentiment for all the sentences in the document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 3; - */ - com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java deleted file mode 100644 index e5cd33bb..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java +++ /dev/null @@ -1,877 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The syntax analysis request message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSyntaxRequest} - */ -public final class AnalyzeSyntaxRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeSyntaxRequest) - AnalyzeSyntaxRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeSyntaxRequest.newBuilder() to construct. - private AnalyzeSyntaxRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeSyntaxRequest() { - encodingType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeSyntaxRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSyntaxRequest.class, - com.google.cloud.language.v1.AnalyzeSyntaxRequest.Builder.class); - } - - public static final int DOCUMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Document document_; - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - @java.lang.Override - public boolean hasDocument() { - return document_ != null; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - @java.lang.Override - public com.google.cloud.language.v1.Document getDocument() { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - return getDocument(); - } - - public static final int ENCODING_TYPE_FIELD_NUMBER = 2; - private int encodingType_; - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (document_ != null) { - output.writeMessage(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - output.writeEnum(2, encodingType_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (document_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encodingType_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeSyntaxRequest)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeSyntaxRequest other = - (com.google.cloud.language.v1.AnalyzeSyntaxRequest) obj; - - if (hasDocument() != other.hasDocument()) return false; - if (hasDocument()) { - if (!getDocument().equals(other.getDocument())) return false; - } - if (encodingType_ != other.encodingType_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocument()) { - hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocument().hashCode(); - } - hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + encodingType_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest 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.language.v1.AnalyzeSyntaxRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest 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.language.v1.AnalyzeSyntaxRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest 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.language.v1.AnalyzeSyntaxRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest 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.language.v1.AnalyzeSyntaxRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest 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.language.v1.AnalyzeSyntaxRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The syntax analysis request message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSyntaxRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeSyntaxRequest) - com.google.cloud.language.v1.AnalyzeSyntaxRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSyntaxRequest.class, - com.google.cloud.language.v1.AnalyzeSyntaxRequest.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeSyntaxRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentBuilder_ == null) { - document_ = null; - } else { - document_ = null; - documentBuilder_ = null; - } - encodingType_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxRequest getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeSyntaxRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxRequest build() { - com.google.cloud.language.v1.AnalyzeSyntaxRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxRequest buildPartial() { - com.google.cloud.language.v1.AnalyzeSyntaxRequest result = - new com.google.cloud.language.v1.AnalyzeSyntaxRequest(this); - if (documentBuilder_ == null) { - result.document_ = document_; - } else { - result.document_ = documentBuilder_.build(); - } - result.encodingType_ = encodingType_; - 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.language.v1.AnalyzeSyntaxRequest) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeSyntaxRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSyntaxRequest other) { - if (other == com.google.cloud.language.v1.AnalyzeSyntaxRequest.getDefaultInstance()) - return this; - if (other.hasDocument()) { - mergeDocument(other.getDocument()); - } - if (other.encodingType_ != 0) { - setEncodingTypeValue(other.getEncodingTypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 16: - { - encodingType_ = input.readEnum(); - - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private com.google.cloud.language.v1.Document document_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - documentBuilder_; - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - public boolean hasDocument() { - return documentBuilder_ != null || document_ != null; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - public com.google.cloud.language.v1.Document getDocument() { - if (documentBuilder_ == null) { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } else { - return documentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - document_ = value; - onChanged(); - } else { - documentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { - if (documentBuilder_ == null) { - document_ = builderForValue.build(); - onChanged(); - } else { - documentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (document_ != null) { - document_ = - com.google.cloud.language.v1.Document.newBuilder(document_) - .mergeFrom(value) - .buildPartial(); - } else { - document_ = value; - } - onChanged(); - } else { - documentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDocument() { - if (documentBuilder_ == null) { - document_ = null; - onChanged(); - } else { - document_ = null; - documentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { - - onChanged(); - return getDocumentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - if (documentBuilder_ != null) { - return documentBuilder_.getMessageOrBuilder(); - } else { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - getDocumentFieldBuilder() { - if (documentBuilder_ == null) { - documentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder>( - getDocument(), getParentForChildren(), isClean()); - document_ = null; - } - return documentBuilder_; - } - - private int encodingType_ = 0; - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The enum numeric value on the wire for encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingTypeValue(int value) { - - encodingType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @param value The encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingType(com.google.cloud.language.v1.EncodingType value) { - if (value == null) { - throw new NullPointerException(); - } - - encodingType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return This builder for chaining. - */ - public Builder clearEncodingType() { - - encodingType_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnalyzeSyntaxRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeSyntaxRequest) - private static final com.google.cloud.language.v1.AnalyzeSyntaxRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeSyntaxRequest(); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeSyntaxRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java deleted file mode 100644 index 346123c3..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeSyntaxRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeSyntaxRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - boolean hasDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - com.google.cloud.language.v1.Document getDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); - - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The enum numeric value on the wire for encodingType. - */ - int getEncodingTypeValue(); - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 2; - * - * @return The encodingType. - */ - com.google.cloud.language.v1.EncodingType getEncodingType(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java deleted file mode 100644 index 5d833f08..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java +++ /dev/null @@ -1,1602 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The syntax analysis response message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSyntaxResponse} - */ -public final class AnalyzeSyntaxResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnalyzeSyntaxResponse) - AnalyzeSyntaxResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnalyzeSyntaxResponse.newBuilder() to construct. - private AnalyzeSyntaxResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnalyzeSyntaxResponse() { - sentences_ = java.util.Collections.emptyList(); - tokens_ = java.util.Collections.emptyList(); - language_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnalyzeSyntaxResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSyntaxResponse.class, - com.google.cloud.language.v1.AnalyzeSyntaxResponse.Builder.class); - } - - public static final int SENTENCES_FIELD_NUMBER = 1; - private java.util.List sentences_; - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public java.util.List getSentencesList() { - return sentences_; - } - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public java.util.List - getSentencesOrBuilderList() { - return sentences_; - } - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public int getSentencesCount() { - return sentences_.size(); - } - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.Sentence getSentences(int index) { - return sentences_.get(index); - } - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index) { - return sentences_.get(index); - } - - public static final int TOKENS_FIELD_NUMBER = 2; - private java.util.List tokens_; - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public java.util.List getTokensList() { - return tokens_; - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public java.util.List - getTokensOrBuilderList() { - return tokens_; - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public int getTokensCount() { - return tokens_.size(); - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public com.google.cloud.language.v1.Token getTokens(int index) { - return tokens_.get(index); - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) { - return tokens_.get(index); - } - - public static final int LANGUAGE_FIELD_NUMBER = 3; - private volatile java.lang.Object language_; - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 3; - * - * @return The language. - */ - @java.lang.Override - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - 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(); - language_ = s; - return s; - } - } - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 3; - * - * @return The bytes for language. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = 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 < sentences_.size(); i++) { - output.writeMessage(1, sentences_.get(i)); - } - for (int i = 0; i < tokens_.size(); i++) { - output.writeMessage(2, tokens_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, language_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < sentences_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sentences_.get(i)); - } - for (int i = 0; i < tokens_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, tokens_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, language_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnalyzeSyntaxResponse)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnalyzeSyntaxResponse other = - (com.google.cloud.language.v1.AnalyzeSyntaxResponse) obj; - - if (!getSentencesList().equals(other.getSentencesList())) return false; - if (!getTokensList().equals(other.getTokensList())) return false; - if (!getLanguage().equals(other.getLanguage())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSentencesCount() > 0) { - hash = (37 * hash) + SENTENCES_FIELD_NUMBER; - hash = (53 * hash) + getSentencesList().hashCode(); - } - if (getTokensCount() > 0) { - hash = (37 * hash) + TOKENS_FIELD_NUMBER; - hash = (53 * hash) + getTokensList().hashCode(); - } - hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getLanguage().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse 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.language.v1.AnalyzeSyntaxResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse 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.language.v1.AnalyzeSyntaxResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse 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.language.v1.AnalyzeSyntaxResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse 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.language.v1.AnalyzeSyntaxResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse 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.language.v1.AnalyzeSyntaxResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The syntax analysis response message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnalyzeSyntaxResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnalyzeSyntaxResponse) - com.google.cloud.language.v1.AnalyzeSyntaxResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnalyzeSyntaxResponse.class, - com.google.cloud.language.v1.AnalyzeSyntaxResponse.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnalyzeSyntaxResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (sentencesBuilder_ == null) { - sentences_ = java.util.Collections.emptyList(); - } else { - sentences_ = null; - sentencesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (tokensBuilder_ == null) { - tokens_ = java.util.Collections.emptyList(); - } else { - tokens_ = null; - tokensBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - language_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxResponse getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnalyzeSyntaxResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxResponse build() { - com.google.cloud.language.v1.AnalyzeSyntaxResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxResponse buildPartial() { - com.google.cloud.language.v1.AnalyzeSyntaxResponse result = - new com.google.cloud.language.v1.AnalyzeSyntaxResponse(this); - int from_bitField0_ = bitField0_; - if (sentencesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sentences_ = sentences_; - } else { - result.sentences_ = sentencesBuilder_.build(); - } - if (tokensBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - tokens_ = java.util.Collections.unmodifiableList(tokens_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.tokens_ = tokens_; - } else { - result.tokens_ = tokensBuilder_.build(); - } - result.language_ = language_; - 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.language.v1.AnalyzeSyntaxResponse) { - return mergeFrom((com.google.cloud.language.v1.AnalyzeSyntaxResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeSyntaxResponse other) { - if (other == com.google.cloud.language.v1.AnalyzeSyntaxResponse.getDefaultInstance()) - return this; - if (sentencesBuilder_ == null) { - if (!other.sentences_.isEmpty()) { - if (sentences_.isEmpty()) { - sentences_ = other.sentences_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSentencesIsMutable(); - sentences_.addAll(other.sentences_); - } - onChanged(); - } - } else { - if (!other.sentences_.isEmpty()) { - if (sentencesBuilder_.isEmpty()) { - sentencesBuilder_.dispose(); - sentencesBuilder_ = null; - sentences_ = other.sentences_; - bitField0_ = (bitField0_ & ~0x00000001); - sentencesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSentencesFieldBuilder() - : null; - } else { - sentencesBuilder_.addAllMessages(other.sentences_); - } - } - } - if (tokensBuilder_ == null) { - if (!other.tokens_.isEmpty()) { - if (tokens_.isEmpty()) { - tokens_ = other.tokens_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureTokensIsMutable(); - tokens_.addAll(other.tokens_); - } - onChanged(); - } - } else { - if (!other.tokens_.isEmpty()) { - if (tokensBuilder_.isEmpty()) { - tokensBuilder_.dispose(); - tokensBuilder_ = null; - tokens_ = other.tokens_; - bitField0_ = (bitField0_ & ~0x00000002); - tokensBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getTokensFieldBuilder() - : null; - } else { - tokensBuilder_.addAllMessages(other.tokens_); - } - } - } - if (!other.getLanguage().isEmpty()) { - language_ = other.language_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Sentence m = - input.readMessage( - com.google.cloud.language.v1.Sentence.parser(), extensionRegistry); - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(m); - } else { - sentencesBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - com.google.cloud.language.v1.Token m = - input.readMessage( - com.google.cloud.language.v1.Token.parser(), extensionRegistry); - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.add(m); - } else { - tokensBuilder_.addMessage(m); - } - break; - } // case 18 - case 26: - { - language_ = input.readStringRequireUtf8(); - - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List sentences_ = - java.util.Collections.emptyList(); - - private void ensureSentencesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - sentences_ = new java.util.ArrayList(sentences_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder> - sentencesBuilder_; - - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public java.util.List getSentencesList() { - if (sentencesBuilder_ == null) { - return java.util.Collections.unmodifiableList(sentences_); - } else { - return sentencesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public int getSentencesCount() { - if (sentencesBuilder_ == null) { - return sentences_.size(); - } else { - return sentencesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence getSentences(int index) { - if (sentencesBuilder_ == null) { - return sentences_.get(index); - } else { - return sentencesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder setSentences(int index, com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.set(index, value); - onChanged(); - } else { - sentencesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder setSentences( - int index, com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.set(index, builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences(com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.add(value); - onChanged(); - } else { - sentencesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences(int index, com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.add(index, value); - onChanged(); - } else { - sentencesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences(com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences( - int index, com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(index, builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addAllSentences( - java.lang.Iterable values) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sentences_); - onChanged(); - } else { - sentencesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder clearSentences() { - if (sentencesBuilder_ == null) { - sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sentencesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder removeSentences(int index) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.remove(index); - onChanged(); - } else { - sentencesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence.Builder getSentencesBuilder(int index) { - return getSentencesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index) { - if (sentencesBuilder_ == null) { - return sentences_.get(index); - } else { - return sentencesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public java.util.List - getSentencesOrBuilderList() { - if (sentencesBuilder_ != null) { - return sentencesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sentences_); - } - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence.Builder addSentencesBuilder() { - return getSentencesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Sentence.getDefaultInstance()); - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence.Builder addSentencesBuilder(int index) { - return getSentencesFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Sentence.getDefaultInstance()); - } - /** - * - * - *
-     * Sentences in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public java.util.List getSentencesBuilderList() { - return getSentencesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder> - getSentencesFieldBuilder() { - if (sentencesBuilder_ == null) { - sentencesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder>( - sentences_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - sentences_ = null; - } - return sentencesBuilder_; - } - - private java.util.List tokens_ = - java.util.Collections.emptyList(); - - private void ensureTokensIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - tokens_ = new java.util.ArrayList(tokens_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Token, - com.google.cloud.language.v1.Token.Builder, - com.google.cloud.language.v1.TokenOrBuilder> - tokensBuilder_; - - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public java.util.List getTokensList() { - if (tokensBuilder_ == null) { - return java.util.Collections.unmodifiableList(tokens_); - } else { - return tokensBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public int getTokensCount() { - if (tokensBuilder_ == null) { - return tokens_.size(); - } else { - return tokensBuilder_.getCount(); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token getTokens(int index) { - if (tokensBuilder_ == null) { - return tokens_.get(index); - } else { - return tokensBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder setTokens(int index, com.google.cloud.language.v1.Token value) { - if (tokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTokensIsMutable(); - tokens_.set(index, value); - onChanged(); - } else { - tokensBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder setTokens( - int index, com.google.cloud.language.v1.Token.Builder builderForValue) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.set(index, builderForValue.build()); - onChanged(); - } else { - tokensBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens(com.google.cloud.language.v1.Token value) { - if (tokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTokensIsMutable(); - tokens_.add(value); - onChanged(); - } else { - tokensBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens(int index, com.google.cloud.language.v1.Token value) { - if (tokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTokensIsMutable(); - tokens_.add(index, value); - onChanged(); - } else { - tokensBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens(com.google.cloud.language.v1.Token.Builder builderForValue) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.add(builderForValue.build()); - onChanged(); - } else { - tokensBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens( - int index, com.google.cloud.language.v1.Token.Builder builderForValue) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.add(index, builderForValue.build()); - onChanged(); - } else { - tokensBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addAllTokens( - java.lang.Iterable values) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tokens_); - onChanged(); - } else { - tokensBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder clearTokens() { - if (tokensBuilder_ == null) { - tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - tokensBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder removeTokens(int index) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.remove(index); - onChanged(); - } else { - tokensBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token.Builder getTokensBuilder(int index) { - return getTokensFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) { - if (tokensBuilder_ == null) { - return tokens_.get(index); - } else { - return tokensBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public java.util.List - getTokensOrBuilderList() { - if (tokensBuilder_ != null) { - return tokensBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tokens_); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token.Builder addTokensBuilder() { - return getTokensFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Token.getDefaultInstance()); - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token.Builder addTokensBuilder(int index) { - return getTokensFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Token.getDefaultInstance()); - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public java.util.List getTokensBuilderList() { - return getTokensFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Token, - com.google.cloud.language.v1.Token.Builder, - com.google.cloud.language.v1.TokenOrBuilder> - getTokensFieldBuilder() { - if (tokensBuilder_ == null) { - tokensBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Token, - com.google.cloud.language.v1.Token.Builder, - com.google.cloud.language.v1.TokenOrBuilder>( - tokens_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); - tokens_ = null; - } - return tokensBuilder_; - } - - private java.lang.Object language_ = ""; - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 3; - * - * @return The language. - */ - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - language_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 3; - * - * @return The bytes for language. - */ - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 3; - * - * @param value The language to set. - * @return This builder for chaining. - */ - public Builder setLanguage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - language_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 3; - * - * @return This builder for chaining. - */ - public Builder clearLanguage() { - - language_ = getDefaultInstance().getLanguage(); - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 3; - * - * @param value The bytes for language to set. - * @return This builder for chaining. - */ - public Builder setLanguageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - language_ = 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.language.v1.AnalyzeSyntaxResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnalyzeSyntaxResponse) - private static final com.google.cloud.language.v1.AnalyzeSyntaxResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnalyzeSyntaxResponse(); - } - - public static com.google.cloud.language.v1.AnalyzeSyntaxResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyzeSyntaxResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnalyzeSyntaxResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java deleted file mode 100644 index 1369f367..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnalyzeSyntaxResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnalyzeSyntaxResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - java.util.List getSentencesList(); - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - com.google.cloud.language.v1.Sentence getSentences(int index); - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - int getSentencesCount(); - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - java.util.List - getSentencesOrBuilderList(); - /** - * - * - *
-   * Sentences in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index); - - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - java.util.List getTokensList(); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - com.google.cloud.language.v1.Token getTokens(int index); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - int getTokensCount(); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - java.util.List getTokensOrBuilderList(); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index); - - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 3; - * - * @return The language. - */ - java.lang.String getLanguage(); - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 3; - * - * @return The bytes for language. - */ - com.google.protobuf.ByteString getLanguageBytes(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java deleted file mode 100644 index 6f7603c5..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java +++ /dev/null @@ -1,2477 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The request message for the text annotation API, which can perform multiple
- * analysis types (sentiment, entities, and syntax) in one call.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest} - */ -public final class AnnotateTextRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnnotateTextRequest) - AnnotateTextRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnnotateTextRequest.newBuilder() to construct. - private AnnotateTextRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnnotateTextRequest() { - encodingType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnnotateTextRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnnotateTextRequest.class, - com.google.cloud.language.v1.AnnotateTextRequest.Builder.class); - } - - public interface FeaturesOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnnotateTextRequest.Features) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Extract syntax information.
-     * 
- * - * bool extract_syntax = 1; - * - * @return The extractSyntax. - */ - boolean getExtractSyntax(); - - /** - * - * - *
-     * Extract entities.
-     * 
- * - * bool extract_entities = 2; - * - * @return The extractEntities. - */ - boolean getExtractEntities(); - - /** - * - * - *
-     * Extract document-level sentiment.
-     * 
- * - * bool extract_document_sentiment = 3; - * - * @return The extractDocumentSentiment. - */ - boolean getExtractDocumentSentiment(); - - /** - * - * - *
-     * Extract entities and their associated sentiment.
-     * 
- * - * bool extract_entity_sentiment = 4; - * - * @return The extractEntitySentiment. - */ - boolean getExtractEntitySentiment(); - - /** - * - * - *
-     * Classify the full document into categories.
-     * 
- * - * bool classify_text = 6; - * - * @return The classifyText. - */ - boolean getClassifyText(); - - /** - * - * - *
-     * The model options to use for classification. Defaults to v1 options
-     * if not specified. Only used if `classify_text` is set to true.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - * - * @return Whether the classificationModelOptions field is set. - */ - boolean hasClassificationModelOptions(); - /** - * - * - *
-     * The model options to use for classification. Defaults to v1 options
-     * if not specified. Only used if `classify_text` is set to true.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - * - * @return The classificationModelOptions. - */ - com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); - /** - * - * - *
-     * The model options to use for classification. Defaults to v1 options
-     * if not specified. Only used if `classify_text` is set to true.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder - getClassificationModelOptionsOrBuilder(); - } - /** - * - * - *
-   * All available features for sentiment, syntax, and semantic analysis.
-   * Setting each one to true will enable that specific analysis for the input.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest.Features} - */ - public static final class Features extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnnotateTextRequest.Features) - FeaturesOrBuilder { - private static final long serialVersionUID = 0L; - // Use Features.newBuilder() to construct. - private Features(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Features() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Features(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnnotateTextRequest.Features.class, - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder.class); - } - - public static final int EXTRACT_SYNTAX_FIELD_NUMBER = 1; - private boolean extractSyntax_; - /** - * - * - *
-     * Extract syntax information.
-     * 
- * - * bool extract_syntax = 1; - * - * @return The extractSyntax. - */ - @java.lang.Override - public boolean getExtractSyntax() { - return extractSyntax_; - } - - public static final int EXTRACT_ENTITIES_FIELD_NUMBER = 2; - private boolean extractEntities_; - /** - * - * - *
-     * Extract entities.
-     * 
- * - * bool extract_entities = 2; - * - * @return The extractEntities. - */ - @java.lang.Override - public boolean getExtractEntities() { - return extractEntities_; - } - - public static final int EXTRACT_DOCUMENT_SENTIMENT_FIELD_NUMBER = 3; - private boolean extractDocumentSentiment_; - /** - * - * - *
-     * Extract document-level sentiment.
-     * 
- * - * bool extract_document_sentiment = 3; - * - * @return The extractDocumentSentiment. - */ - @java.lang.Override - public boolean getExtractDocumentSentiment() { - return extractDocumentSentiment_; - } - - public static final int EXTRACT_ENTITY_SENTIMENT_FIELD_NUMBER = 4; - private boolean extractEntitySentiment_; - /** - * - * - *
-     * Extract entities and their associated sentiment.
-     * 
- * - * bool extract_entity_sentiment = 4; - * - * @return The extractEntitySentiment. - */ - @java.lang.Override - public boolean getExtractEntitySentiment() { - return extractEntitySentiment_; - } - - public static final int CLASSIFY_TEXT_FIELD_NUMBER = 6; - private boolean classifyText_; - /** - * - * - *
-     * Classify the full document into categories.
-     * 
- * - * bool classify_text = 6; - * - * @return The classifyText. - */ - @java.lang.Override - public boolean getClassifyText() { - return classifyText_; - } - - public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 10; - private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; - /** - * - * - *
-     * The model options to use for classification. Defaults to v1 options
-     * if not specified. Only used if `classify_text` is set to true.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - * - * @return Whether the classificationModelOptions field is set. - */ - @java.lang.Override - public boolean hasClassificationModelOptions() { - return classificationModelOptions_ != null; - } - /** - * - * - *
-     * The model options to use for classification. Defaults to v1 options
-     * if not specified. Only used if `classify_text` is set to true.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - * - * @return The classificationModelOptions. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { - return classificationModelOptions_ == null - ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() - : classificationModelOptions_; - } - /** - * - * - *
-     * The model options to use for classification. Defaults to v1 options
-     * if not specified. Only used if `classify_text` is set to true.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder - getClassificationModelOptionsOrBuilder() { - return getClassificationModelOptions(); - } - - 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 (extractSyntax_ != false) { - output.writeBool(1, extractSyntax_); - } - if (extractEntities_ != false) { - output.writeBool(2, extractEntities_); - } - if (extractDocumentSentiment_ != false) { - output.writeBool(3, extractDocumentSentiment_); - } - if (extractEntitySentiment_ != false) { - output.writeBool(4, extractEntitySentiment_); - } - if (classifyText_ != false) { - output.writeBool(6, classifyText_); - } - if (classificationModelOptions_ != null) { - output.writeMessage(10, getClassificationModelOptions()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (extractSyntax_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, extractSyntax_); - } - if (extractEntities_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, extractEntities_); - } - if (extractDocumentSentiment_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, extractDocumentSentiment_); - } - if (extractEntitySentiment_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, extractEntitySentiment_); - } - if (classifyText_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, classifyText_); - } - if (classificationModelOptions_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 10, getClassificationModelOptions()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnnotateTextRequest.Features)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnnotateTextRequest.Features other = - (com.google.cloud.language.v1.AnnotateTextRequest.Features) obj; - - if (getExtractSyntax() != other.getExtractSyntax()) return false; - if (getExtractEntities() != other.getExtractEntities()) return false; - if (getExtractDocumentSentiment() != other.getExtractDocumentSentiment()) return false; - if (getExtractEntitySentiment() != other.getExtractEntitySentiment()) return false; - if (getClassifyText() != other.getClassifyText()) return false; - if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; - if (hasClassificationModelOptions()) { - if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + EXTRACT_SYNTAX_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractSyntax()); - hash = (37 * hash) + EXTRACT_ENTITIES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntities()); - hash = (37 * hash) + EXTRACT_DOCUMENT_SENTIMENT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractDocumentSentiment()); - hash = (37 * hash) + EXTRACT_ENTITY_SENTIMENT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntitySentiment()); - hash = (37 * hash) + CLASSIFY_TEXT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClassifyText()); - if (hasClassificationModelOptions()) { - hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getClassificationModelOptions().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features 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.language.v1.AnnotateTextRequest.Features parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features 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.language.v1.AnnotateTextRequest.Features parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features 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.language.v1.AnnotateTextRequest.Features parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features 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.language.v1.AnnotateTextRequest.Features parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features 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.language.v1.AnnotateTextRequest.Features 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; - } - /** - * - * - *
-     * All available features for sentiment, syntax, and semantic analysis.
-     * Setting each one to true will enable that specific analysis for the input.
-     * 
- * - * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest.Features} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnnotateTextRequest.Features) - com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnnotateTextRequest.Features.class, - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnnotateTextRequest.Features.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - extractSyntax_ = false; - - extractEntities_ = false; - - extractDocumentSentiment_ = false; - - extractEntitySentiment_ = false; - - classifyText_ = false; - - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptions_ = null; - } else { - classificationModelOptions_ = null; - classificationModelOptionsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest.Features build() { - com.google.cloud.language.v1.AnnotateTextRequest.Features result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest.Features buildPartial() { - com.google.cloud.language.v1.AnnotateTextRequest.Features result = - new com.google.cloud.language.v1.AnnotateTextRequest.Features(this); - result.extractSyntax_ = extractSyntax_; - result.extractEntities_ = extractEntities_; - result.extractDocumentSentiment_ = extractDocumentSentiment_; - result.extractEntitySentiment_ = extractEntitySentiment_; - result.classifyText_ = classifyText_; - if (classificationModelOptionsBuilder_ == null) { - result.classificationModelOptions_ = classificationModelOptions_; - } else { - result.classificationModelOptions_ = classificationModelOptionsBuilder_.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.language.v1.AnnotateTextRequest.Features) { - return mergeFrom((com.google.cloud.language.v1.AnnotateTextRequest.Features) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest.Features other) { - if (other == com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance()) - return this; - if (other.getExtractSyntax() != false) { - setExtractSyntax(other.getExtractSyntax()); - } - if (other.getExtractEntities() != false) { - setExtractEntities(other.getExtractEntities()); - } - if (other.getExtractDocumentSentiment() != false) { - setExtractDocumentSentiment(other.getExtractDocumentSentiment()); - } - if (other.getExtractEntitySentiment() != false) { - setExtractEntitySentiment(other.getExtractEntitySentiment()); - } - if (other.getClassifyText() != false) { - setClassifyText(other.getClassifyText()); - } - if (other.hasClassificationModelOptions()) { - mergeClassificationModelOptions(other.getClassificationModelOptions()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - extractSyntax_ = input.readBool(); - - break; - } // case 8 - case 16: - { - extractEntities_ = input.readBool(); - - break; - } // case 16 - case 24: - { - extractDocumentSentiment_ = input.readBool(); - - break; - } // case 24 - case 32: - { - extractEntitySentiment_ = input.readBool(); - - break; - } // case 32 - case 48: - { - classifyText_ = input.readBool(); - - break; - } // case 48 - case 82: - { - input.readMessage( - getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 82 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private boolean extractSyntax_; - /** - * - * - *
-       * Extract syntax information.
-       * 
- * - * bool extract_syntax = 1; - * - * @return The extractSyntax. - */ - @java.lang.Override - public boolean getExtractSyntax() { - return extractSyntax_; - } - /** - * - * - *
-       * Extract syntax information.
-       * 
- * - * bool extract_syntax = 1; - * - * @param value The extractSyntax to set. - * @return This builder for chaining. - */ - public Builder setExtractSyntax(boolean value) { - - extractSyntax_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Extract syntax information.
-       * 
- * - * bool extract_syntax = 1; - * - * @return This builder for chaining. - */ - public Builder clearExtractSyntax() { - - extractSyntax_ = false; - onChanged(); - return this; - } - - private boolean extractEntities_; - /** - * - * - *
-       * Extract entities.
-       * 
- * - * bool extract_entities = 2; - * - * @return The extractEntities. - */ - @java.lang.Override - public boolean getExtractEntities() { - return extractEntities_; - } - /** - * - * - *
-       * Extract entities.
-       * 
- * - * bool extract_entities = 2; - * - * @param value The extractEntities to set. - * @return This builder for chaining. - */ - public Builder setExtractEntities(boolean value) { - - extractEntities_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Extract entities.
-       * 
- * - * bool extract_entities = 2; - * - * @return This builder for chaining. - */ - public Builder clearExtractEntities() { - - extractEntities_ = false; - onChanged(); - return this; - } - - private boolean extractDocumentSentiment_; - /** - * - * - *
-       * Extract document-level sentiment.
-       * 
- * - * bool extract_document_sentiment = 3; - * - * @return The extractDocumentSentiment. - */ - @java.lang.Override - public boolean getExtractDocumentSentiment() { - return extractDocumentSentiment_; - } - /** - * - * - *
-       * Extract document-level sentiment.
-       * 
- * - * bool extract_document_sentiment = 3; - * - * @param value The extractDocumentSentiment to set. - * @return This builder for chaining. - */ - public Builder setExtractDocumentSentiment(boolean value) { - - extractDocumentSentiment_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Extract document-level sentiment.
-       * 
- * - * bool extract_document_sentiment = 3; - * - * @return This builder for chaining. - */ - public Builder clearExtractDocumentSentiment() { - - extractDocumentSentiment_ = false; - onChanged(); - return this; - } - - private boolean extractEntitySentiment_; - /** - * - * - *
-       * Extract entities and their associated sentiment.
-       * 
- * - * bool extract_entity_sentiment = 4; - * - * @return The extractEntitySentiment. - */ - @java.lang.Override - public boolean getExtractEntitySentiment() { - return extractEntitySentiment_; - } - /** - * - * - *
-       * Extract entities and their associated sentiment.
-       * 
- * - * bool extract_entity_sentiment = 4; - * - * @param value The extractEntitySentiment to set. - * @return This builder for chaining. - */ - public Builder setExtractEntitySentiment(boolean value) { - - extractEntitySentiment_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Extract entities and their associated sentiment.
-       * 
- * - * bool extract_entity_sentiment = 4; - * - * @return This builder for chaining. - */ - public Builder clearExtractEntitySentiment() { - - extractEntitySentiment_ = false; - onChanged(); - return this; - } - - private boolean classifyText_; - /** - * - * - *
-       * Classify the full document into categories.
-       * 
- * - * bool classify_text = 6; - * - * @return The classifyText. - */ - @java.lang.Override - public boolean getClassifyText() { - return classifyText_; - } - /** - * - * - *
-       * Classify the full document into categories.
-       * 
- * - * bool classify_text = 6; - * - * @param value The classifyText to set. - * @return This builder for chaining. - */ - public Builder setClassifyText(boolean value) { - - classifyText_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Classify the full document into categories.
-       * 
- * - * bool classify_text = 6; - * - * @return This builder for chaining. - */ - public Builder clearClassifyText() { - - classifyText_ = false; - onChanged(); - return this; - } - - private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions, - com.google.cloud.language.v1.ClassificationModelOptions.Builder, - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> - classificationModelOptionsBuilder_; - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - * - * @return Whether the classificationModelOptions field is set. - */ - public boolean hasClassificationModelOptions() { - return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - * - * @return The classificationModelOptions. - */ - public com.google.cloud.language.v1.ClassificationModelOptions - getClassificationModelOptions() { - if (classificationModelOptionsBuilder_ == null) { - return classificationModelOptions_ == null - ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() - : classificationModelOptions_; - } else { - return classificationModelOptionsBuilder_.getMessage(); - } - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - public Builder setClassificationModelOptions( - com.google.cloud.language.v1.ClassificationModelOptions value) { - if (classificationModelOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - classificationModelOptions_ = value; - onChanged(); - } else { - classificationModelOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - public Builder setClassificationModelOptions( - com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptions_ = builderForValue.build(); - onChanged(); - } else { - classificationModelOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - public Builder mergeClassificationModelOptions( - com.google.cloud.language.v1.ClassificationModelOptions value) { - if (classificationModelOptionsBuilder_ == null) { - if (classificationModelOptions_ != null) { - classificationModelOptions_ = - com.google.cloud.language.v1.ClassificationModelOptions.newBuilder( - classificationModelOptions_) - .mergeFrom(value) - .buildPartial(); - } else { - classificationModelOptions_ = value; - } - onChanged(); - } else { - classificationModelOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - public Builder clearClassificationModelOptions() { - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptions_ = null; - onChanged(); - } else { - classificationModelOptions_ = null; - classificationModelOptionsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - public com.google.cloud.language.v1.ClassificationModelOptions.Builder - getClassificationModelOptionsBuilder() { - - onChanged(); - return getClassificationModelOptionsFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder - getClassificationModelOptionsOrBuilder() { - if (classificationModelOptionsBuilder_ != null) { - return classificationModelOptionsBuilder_.getMessageOrBuilder(); - } else { - return classificationModelOptions_ == null - ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() - : classificationModelOptions_; - } - } - /** - * - * - *
-       * The model options to use for classification. Defaults to v1 options
-       * if not specified. Only used if `classify_text` is set to true.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions, - com.google.cloud.language.v1.ClassificationModelOptions.Builder, - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> - getClassificationModelOptionsFieldBuilder() { - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptionsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions, - com.google.cloud.language.v1.ClassificationModelOptions.Builder, - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( - getClassificationModelOptions(), getParentForChildren(), isClean()); - classificationModelOptions_ = null; - } - return classificationModelOptionsBuilder_; - } - - @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.language.v1.AnnotateTextRequest.Features) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnnotateTextRequest.Features) - private static final com.google.cloud.language.v1.AnnotateTextRequest.Features DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnnotateTextRequest.Features(); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Features parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int DOCUMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Document document_; - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - @java.lang.Override - public boolean hasDocument() { - return document_ != null; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - @java.lang.Override - public com.google.cloud.language.v1.Document getDocument() { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - return getDocument(); - } - - public static final int FEATURES_FIELD_NUMBER = 2; - private com.google.cloud.language.v1.AnnotateTextRequest.Features features_; - /** - * - * - *
-   * Required. The enabled features.
-   * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the features field is set. - */ - @java.lang.Override - public boolean hasFeatures() { - return features_ != null; - } - /** - * - * - *
-   * Required. The enabled features.
-   * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The features. - */ - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { - return features_ == null - ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() - : features_; - } - /** - * - * - *
-   * Required. The enabled features.
-   * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder getFeaturesOrBuilder() { - return getFeatures(); - } - - public static final int ENCODING_TYPE_FIELD_NUMBER = 3; - private int encodingType_; - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (document_ != null) { - output.writeMessage(1, getDocument()); - } - if (features_ != null) { - output.writeMessage(2, getFeatures()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - output.writeEnum(3, encodingType_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (document_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); - } - if (features_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFeatures()); - } - if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encodingType_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnnotateTextRequest)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnnotateTextRequest other = - (com.google.cloud.language.v1.AnnotateTextRequest) obj; - - if (hasDocument() != other.hasDocument()) return false; - if (hasDocument()) { - if (!getDocument().equals(other.getDocument())) return false; - } - if (hasFeatures() != other.hasFeatures()) return false; - if (hasFeatures()) { - if (!getFeatures().equals(other.getFeatures())) return false; - } - if (encodingType_ != other.encodingType_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocument()) { - hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocument().hashCode(); - } - if (hasFeatures()) { - hash = (37 * hash) + FEATURES_FIELD_NUMBER; - hash = (53 * hash) + getFeatures().hashCode(); - } - hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + encodingType_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest 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.language.v1.AnnotateTextRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest 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.language.v1.AnnotateTextRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest 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.language.v1.AnnotateTextRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest 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.language.v1.AnnotateTextRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest 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.language.v1.AnnotateTextRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The request message for the text annotation API, which can perform multiple
-   * analysis types (sentiment, entities, and syntax) in one call.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnnotateTextRequest) - com.google.cloud.language.v1.AnnotateTextRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnnotateTextRequest.class, - com.google.cloud.language.v1.AnnotateTextRequest.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnnotateTextRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentBuilder_ == null) { - document_ = null; - } else { - document_ = null; - documentBuilder_ = null; - } - if (featuresBuilder_ == null) { - features_ = null; - } else { - features_ = null; - featuresBuilder_ = null; - } - encodingType_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnnotateTextRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest build() { - com.google.cloud.language.v1.AnnotateTextRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest buildPartial() { - com.google.cloud.language.v1.AnnotateTextRequest result = - new com.google.cloud.language.v1.AnnotateTextRequest(this); - if (documentBuilder_ == null) { - result.document_ = document_; - } else { - result.document_ = documentBuilder_.build(); - } - if (featuresBuilder_ == null) { - result.features_ = features_; - } else { - result.features_ = featuresBuilder_.build(); - } - result.encodingType_ = encodingType_; - 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.language.v1.AnnotateTextRequest) { - return mergeFrom((com.google.cloud.language.v1.AnnotateTextRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest other) { - if (other == com.google.cloud.language.v1.AnnotateTextRequest.getDefaultInstance()) - return this; - if (other.hasDocument()) { - mergeDocument(other.getDocument()); - } - if (other.hasFeatures()) { - mergeFeatures(other.getFeatures()); - } - if (other.encodingType_ != 0) { - setEncodingTypeValue(other.getEncodingTypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 18: - { - input.readMessage(getFeaturesFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 18 - case 24: - { - encodingType_ = input.readEnum(); - - break; - } // case 24 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private com.google.cloud.language.v1.Document document_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - documentBuilder_; - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - public boolean hasDocument() { - return documentBuilder_ != null || document_ != null; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - public com.google.cloud.language.v1.Document getDocument() { - if (documentBuilder_ == null) { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } else { - return documentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - document_ = value; - onChanged(); - } else { - documentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { - if (documentBuilder_ == null) { - document_ = builderForValue.build(); - onChanged(); - } else { - documentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (document_ != null) { - document_ = - com.google.cloud.language.v1.Document.newBuilder(document_) - .mergeFrom(value) - .buildPartial(); - } else { - document_ = value; - } - onChanged(); - } else { - documentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDocument() { - if (documentBuilder_ == null) { - document_ = null; - onChanged(); - } else { - document_ = null; - documentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { - - onChanged(); - return getDocumentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - if (documentBuilder_ != null) { - return documentBuilder_.getMessageOrBuilder(); - } else { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - getDocumentFieldBuilder() { - if (documentBuilder_ == null) { - documentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder>( - getDocument(), getParentForChildren(), isClean()); - document_ = null; - } - return documentBuilder_; - } - - private com.google.cloud.language.v1.AnnotateTextRequest.Features features_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.AnnotateTextRequest.Features, - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder, - com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder> - featuresBuilder_; - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the features field is set. - */ - public boolean hasFeatures() { - return featuresBuilder_ != null || features_ != null; - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The features. - */ - public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { - if (featuresBuilder_ == null) { - return features_ == null - ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() - : features_; - } else { - return featuresBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Features value) { - if (featuresBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - features_ = value; - onChanged(); - } else { - featuresBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setFeatures( - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder builderForValue) { - if (featuresBuilder_ == null) { - features_ = builderForValue.build(); - onChanged(); - } else { - featuresBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Features value) { - if (featuresBuilder_ == null) { - if (features_ != null) { - features_ = - com.google.cloud.language.v1.AnnotateTextRequest.Features.newBuilder(features_) - .mergeFrom(value) - .buildPartial(); - } else { - features_ = value; - } - onChanged(); - } else { - featuresBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearFeatures() { - if (featuresBuilder_ == null) { - features_ = null; - onChanged(); - } else { - features_ = null; - featuresBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder getFeaturesBuilder() { - - onChanged(); - return getFeaturesFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder - getFeaturesOrBuilder() { - if (featuresBuilder_ != null) { - return featuresBuilder_.getMessageOrBuilder(); - } else { - return features_ == null - ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() - : features_; - } - } - /** - * - * - *
-     * Required. The enabled features.
-     * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.AnnotateTextRequest.Features, - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder, - com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder> - getFeaturesFieldBuilder() { - if (featuresBuilder_ == null) { - featuresBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.AnnotateTextRequest.Features, - com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder, - com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder>( - getFeatures(), getParentForChildren(), isClean()); - features_ = null; - } - return featuresBuilder_; - } - - private int encodingType_ = 0; - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return The enum numeric value on the wire for encodingType. - */ - @java.lang.Override - public int getEncodingTypeValue() { - return encodingType_; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @param value The enum numeric value on the wire for encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingTypeValue(int value) { - - encodingType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return The encodingType. - */ - @java.lang.Override - public com.google.cloud.language.v1.EncodingType getEncodingType() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.EncodingType result = - com.google.cloud.language.v1.EncodingType.valueOf(encodingType_); - return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @param value The encodingType to set. - * @return This builder for chaining. - */ - public Builder setEncodingType(com.google.cloud.language.v1.EncodingType value) { - if (value == null) { - throw new NullPointerException(); - } - - encodingType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The encoding type used by the API to calculate offsets.
-     * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return This builder for chaining. - */ - public Builder clearEncodingType() { - - encodingType_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnnotateTextRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnnotateTextRequest) - private static final com.google.cloud.language.v1.AnnotateTextRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnnotateTextRequest(); - } - - public static com.google.cloud.language.v1.AnnotateTextRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnnotateTextRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java deleted file mode 100644 index db69924b..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnnotateTextRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnnotateTextRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - boolean hasDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - com.google.cloud.language.v1.Document getDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); - - /** - * - * - *
-   * Required. The enabled features.
-   * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the features field is set. - */ - boolean hasFeatures(); - /** - * - * - *
-   * Required. The enabled features.
-   * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The features. - */ - com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures(); - /** - * - * - *
-   * Required. The enabled features.
-   * 
- * - * - * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder getFeaturesOrBuilder(); - - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return The enum numeric value on the wire for encodingType. - */ - int getEncodingTypeValue(); - /** - * - * - *
-   * The encoding type used by the API to calculate offsets.
-   * 
- * - * .google.cloud.language.v1.EncodingType encoding_type = 3; - * - * @return The encodingType. - */ - com.google.cloud.language.v1.EncodingType getEncodingType(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java deleted file mode 100644 index 9f3ad604..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java +++ /dev/null @@ -1,2980 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The text annotations response message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.AnnotateTextResponse} - */ -public final class AnnotateTextResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnnotateTextResponse) - AnnotateTextResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnnotateTextResponse.newBuilder() to construct. - private AnnotateTextResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AnnotateTextResponse() { - sentences_ = java.util.Collections.emptyList(); - tokens_ = java.util.Collections.emptyList(); - entities_ = java.util.Collections.emptyList(); - language_ = ""; - categories_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AnnotateTextResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnnotateTextResponse.class, - com.google.cloud.language.v1.AnnotateTextResponse.Builder.class); - } - - public static final int SENTENCES_FIELD_NUMBER = 1; - private java.util.List sentences_; - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public java.util.List getSentencesList() { - return sentences_; - } - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public java.util.List - getSentencesOrBuilderList() { - return sentences_; - } - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public int getSentencesCount() { - return sentences_.size(); - } - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.Sentence getSentences(int index) { - return sentences_.get(index); - } - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index) { - return sentences_.get(index); - } - - public static final int TOKENS_FIELD_NUMBER = 2; - private java.util.List tokens_; - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public java.util.List getTokensList() { - return tokens_; - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public java.util.List - getTokensOrBuilderList() { - return tokens_; - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public int getTokensCount() { - return tokens_.size(); - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public com.google.cloud.language.v1.Token getTokens(int index) { - return tokens_.get(index); - } - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - @java.lang.Override - public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) { - return tokens_.get(index); - } - - public static final int ENTITIES_FIELD_NUMBER = 3; - private java.util.List entities_; - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - @java.lang.Override - public java.util.List getEntitiesList() { - return entities_; - } - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - @java.lang.Override - public java.util.List - getEntitiesOrBuilderList() { - return entities_; - } - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - @java.lang.Override - public int getEntitiesCount() { - return entities_.size(); - } - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - @java.lang.Override - public com.google.cloud.language.v1.Entity getEntities(int index) { - return entities_.get(index); - } - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - @java.lang.Override - public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index) { - return entities_.get(index); - } - - public static final int DOCUMENT_SENTIMENT_FIELD_NUMBER = 4; - private com.google.cloud.language.v1.Sentiment documentSentiment_; - /** - * - * - *
-   * The overall sentiment for the document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - * - * @return Whether the documentSentiment field is set. - */ - @java.lang.Override - public boolean hasDocumentSentiment() { - return documentSentiment_ != null; - } - /** - * - * - *
-   * The overall sentiment for the document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - * - * @return The documentSentiment. - */ - @java.lang.Override - public com.google.cloud.language.v1.Sentiment getDocumentSentiment() { - return documentSentiment_ == null - ? com.google.cloud.language.v1.Sentiment.getDefaultInstance() - : documentSentiment_; - } - /** - * - * - *
-   * The overall sentiment for the document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - @java.lang.Override - public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBuilder() { - return getDocumentSentiment(); - } - - public static final int LANGUAGE_FIELD_NUMBER = 5; - private volatile java.lang.Object language_; - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 5; - * - * @return The language. - */ - @java.lang.Override - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - 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(); - language_ = s; - return s; - } - } - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 5; - * - * @return The bytes for language. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CATEGORIES_FIELD_NUMBER = 6; - private java.util.List categories_; - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - @java.lang.Override - public java.util.List getCategoriesList() { - return categories_; - } - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - @java.lang.Override - public java.util.List - getCategoriesOrBuilderList() { - return categories_; - } - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - @java.lang.Override - public int getCategoriesCount() { - return categories_.size(); - } - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategory getCategories(int index) { - return categories_.get(index); - } - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategoryOrBuilder getCategoriesOrBuilder( - int index) { - return categories_.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 < sentences_.size(); i++) { - output.writeMessage(1, sentences_.get(i)); - } - for (int i = 0; i < tokens_.size(); i++) { - output.writeMessage(2, tokens_.get(i)); - } - for (int i = 0; i < entities_.size(); i++) { - output.writeMessage(3, entities_.get(i)); - } - if (documentSentiment_ != null) { - output.writeMessage(4, getDocumentSentiment()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, language_); - } - for (int i = 0; i < categories_.size(); i++) { - output.writeMessage(6, categories_.get(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < sentences_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sentences_.get(i)); - } - for (int i = 0; i < tokens_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, tokens_.get(i)); - } - for (int i = 0; i < entities_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, entities_.get(i)); - } - if (documentSentiment_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentSentiment()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, language_); - } - for (int i = 0; i < categories_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, categories_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.AnnotateTextResponse)) { - return super.equals(obj); - } - com.google.cloud.language.v1.AnnotateTextResponse other = - (com.google.cloud.language.v1.AnnotateTextResponse) obj; - - if (!getSentencesList().equals(other.getSentencesList())) return false; - if (!getTokensList().equals(other.getTokensList())) return false; - if (!getEntitiesList().equals(other.getEntitiesList())) return false; - if (hasDocumentSentiment() != other.hasDocumentSentiment()) return false; - if (hasDocumentSentiment()) { - if (!getDocumentSentiment().equals(other.getDocumentSentiment())) return false; - } - if (!getLanguage().equals(other.getLanguage())) return false; - if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSentencesCount() > 0) { - hash = (37 * hash) + SENTENCES_FIELD_NUMBER; - hash = (53 * hash) + getSentencesList().hashCode(); - } - if (getTokensCount() > 0) { - hash = (37 * hash) + TOKENS_FIELD_NUMBER; - hash = (53 * hash) + getTokensList().hashCode(); - } - if (getEntitiesCount() > 0) { - hash = (37 * hash) + ENTITIES_FIELD_NUMBER; - hash = (53 * hash) + getEntitiesList().hashCode(); - } - if (hasDocumentSentiment()) { - hash = (37 * hash) + DOCUMENT_SENTIMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocumentSentiment().hashCode(); - } - hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getLanguage().hashCode(); - if (getCategoriesCount() > 0) { - hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; - hash = (53 * hash) + getCategoriesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.AnnotateTextResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse 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.language.v1.AnnotateTextResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse 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.language.v1.AnnotateTextResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse 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.language.v1.AnnotateTextResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse 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.language.v1.AnnotateTextResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse 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.language.v1.AnnotateTextResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The text annotations response message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.AnnotateTextResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnnotateTextResponse) - com.google.cloud.language.v1.AnnotateTextResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.AnnotateTextResponse.class, - com.google.cloud.language.v1.AnnotateTextResponse.Builder.class); - } - - // Construct using com.google.cloud.language.v1.AnnotateTextResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (sentencesBuilder_ == null) { - sentences_ = java.util.Collections.emptyList(); - } else { - sentences_ = null; - sentencesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (tokensBuilder_ == null) { - tokens_ = java.util.Collections.emptyList(); - } else { - tokens_ = null; - tokensBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - if (entitiesBuilder_ == null) { - entities_ = java.util.Collections.emptyList(); - } else { - entities_ = null; - entitiesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - if (documentSentimentBuilder_ == null) { - documentSentiment_ = null; - } else { - documentSentiment_ = null; - documentSentimentBuilder_ = null; - } - language_ = ""; - - if (categoriesBuilder_ == null) { - categories_ = java.util.Collections.emptyList(); - } else { - categories_ = null; - categoriesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextResponse getDefaultInstanceForType() { - return com.google.cloud.language.v1.AnnotateTextResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextResponse build() { - com.google.cloud.language.v1.AnnotateTextResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextResponse buildPartial() { - com.google.cloud.language.v1.AnnotateTextResponse result = - new com.google.cloud.language.v1.AnnotateTextResponse(this); - int from_bitField0_ = bitField0_; - if (sentencesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - sentences_ = java.util.Collections.unmodifiableList(sentences_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sentences_ = sentences_; - } else { - result.sentences_ = sentencesBuilder_.build(); - } - if (tokensBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - tokens_ = java.util.Collections.unmodifiableList(tokens_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.tokens_ = tokens_; - } else { - result.tokens_ = tokensBuilder_.build(); - } - if (entitiesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - entities_ = java.util.Collections.unmodifiableList(entities_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.entities_ = entities_; - } else { - result.entities_ = entitiesBuilder_.build(); - } - if (documentSentimentBuilder_ == null) { - result.documentSentiment_ = documentSentiment_; - } else { - result.documentSentiment_ = documentSentimentBuilder_.build(); - } - result.language_ = language_; - if (categoriesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.categories_ = categories_; - } else { - result.categories_ = categoriesBuilder_.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.language.v1.AnnotateTextResponse) { - return mergeFrom((com.google.cloud.language.v1.AnnotateTextResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextResponse other) { - if (other == com.google.cloud.language.v1.AnnotateTextResponse.getDefaultInstance()) - return this; - if (sentencesBuilder_ == null) { - if (!other.sentences_.isEmpty()) { - if (sentences_.isEmpty()) { - sentences_ = other.sentences_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSentencesIsMutable(); - sentences_.addAll(other.sentences_); - } - onChanged(); - } - } else { - if (!other.sentences_.isEmpty()) { - if (sentencesBuilder_.isEmpty()) { - sentencesBuilder_.dispose(); - sentencesBuilder_ = null; - sentences_ = other.sentences_; - bitField0_ = (bitField0_ & ~0x00000001); - sentencesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSentencesFieldBuilder() - : null; - } else { - sentencesBuilder_.addAllMessages(other.sentences_); - } - } - } - if (tokensBuilder_ == null) { - if (!other.tokens_.isEmpty()) { - if (tokens_.isEmpty()) { - tokens_ = other.tokens_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureTokensIsMutable(); - tokens_.addAll(other.tokens_); - } - onChanged(); - } - } else { - if (!other.tokens_.isEmpty()) { - if (tokensBuilder_.isEmpty()) { - tokensBuilder_.dispose(); - tokensBuilder_ = null; - tokens_ = other.tokens_; - bitField0_ = (bitField0_ & ~0x00000002); - tokensBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getTokensFieldBuilder() - : null; - } else { - tokensBuilder_.addAllMessages(other.tokens_); - } - } - } - if (entitiesBuilder_ == null) { - if (!other.entities_.isEmpty()) { - if (entities_.isEmpty()) { - entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureEntitiesIsMutable(); - entities_.addAll(other.entities_); - } - onChanged(); - } - } else { - if (!other.entities_.isEmpty()) { - if (entitiesBuilder_.isEmpty()) { - entitiesBuilder_.dispose(); - entitiesBuilder_ = null; - entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000004); - entitiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEntitiesFieldBuilder() - : null; - } else { - entitiesBuilder_.addAllMessages(other.entities_); - } - } - } - if (other.hasDocumentSentiment()) { - mergeDocumentSentiment(other.getDocumentSentiment()); - } - if (!other.getLanguage().isEmpty()) { - language_ = other.language_; - onChanged(); - } - if (categoriesBuilder_ == null) { - if (!other.categories_.isEmpty()) { - if (categories_.isEmpty()) { - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureCategoriesIsMutable(); - categories_.addAll(other.categories_); - } - onChanged(); - } - } else { - if (!other.categories_.isEmpty()) { - if (categoriesBuilder_.isEmpty()) { - categoriesBuilder_.dispose(); - categoriesBuilder_ = null; - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000008); - categoriesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getCategoriesFieldBuilder() - : null; - } else { - categoriesBuilder_.addAllMessages(other.categories_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.Sentence m = - input.readMessage( - com.google.cloud.language.v1.Sentence.parser(), extensionRegistry); - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(m); - } else { - sentencesBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - com.google.cloud.language.v1.Token m = - input.readMessage( - com.google.cloud.language.v1.Token.parser(), extensionRegistry); - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.add(m); - } else { - tokensBuilder_.addMessage(m); - } - break; - } // case 18 - case 26: - { - com.google.cloud.language.v1.Entity m = - input.readMessage( - com.google.cloud.language.v1.Entity.parser(), extensionRegistry); - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(m); - } else { - entitiesBuilder_.addMessage(m); - } - break; - } // case 26 - case 34: - { - input.readMessage( - getDocumentSentimentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 34 - case 42: - { - language_ = input.readStringRequireUtf8(); - - break; - } // case 42 - case 50: - { - com.google.cloud.language.v1.ClassificationCategory m = - input.readMessage( - com.google.cloud.language.v1.ClassificationCategory.parser(), - extensionRegistry); - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(m); - } else { - categoriesBuilder_.addMessage(m); - } - break; - } // case 50 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List sentences_ = - java.util.Collections.emptyList(); - - private void ensureSentencesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - sentences_ = new java.util.ArrayList(sentences_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder> - sentencesBuilder_; - - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public java.util.List getSentencesList() { - if (sentencesBuilder_ == null) { - return java.util.Collections.unmodifiableList(sentences_); - } else { - return sentencesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public int getSentencesCount() { - if (sentencesBuilder_ == null) { - return sentences_.size(); - } else { - return sentencesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence getSentences(int index) { - if (sentencesBuilder_ == null) { - return sentences_.get(index); - } else { - return sentencesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder setSentences(int index, com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.set(index, value); - onChanged(); - } else { - sentencesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder setSentences( - int index, com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.set(index, builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences(com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.add(value); - onChanged(); - } else { - sentencesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences(int index, com.google.cloud.language.v1.Sentence value) { - if (sentencesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSentencesIsMutable(); - sentences_.add(index, value); - onChanged(); - } else { - sentencesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences(com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addSentences( - int index, com.google.cloud.language.v1.Sentence.Builder builderForValue) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.add(index, builderForValue.build()); - onChanged(); - } else { - sentencesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder addAllSentences( - java.lang.Iterable values) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sentences_); - onChanged(); - } else { - sentencesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder clearSentences() { - if (sentencesBuilder_ == null) { - sentences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sentencesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public Builder removeSentences(int index) { - if (sentencesBuilder_ == null) { - ensureSentencesIsMutable(); - sentences_.remove(index); - onChanged(); - } else { - sentencesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence.Builder getSentencesBuilder(int index) { - return getSentencesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index) { - if (sentencesBuilder_ == null) { - return sentences_.get(index); - } else { - return sentencesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public java.util.List - getSentencesOrBuilderList() { - if (sentencesBuilder_ != null) { - return sentencesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sentences_); - } - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence.Builder addSentencesBuilder() { - return getSentencesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Sentence.getDefaultInstance()); - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public com.google.cloud.language.v1.Sentence.Builder addSentencesBuilder(int index) { - return getSentencesFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Sentence.getDefaultInstance()); - } - /** - * - * - *
-     * Sentences in the input document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - public java.util.List getSentencesBuilderList() { - return getSentencesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder> - getSentencesFieldBuilder() { - if (sentencesBuilder_ == null) { - sentencesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Sentence, - com.google.cloud.language.v1.Sentence.Builder, - com.google.cloud.language.v1.SentenceOrBuilder>( - sentences_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - sentences_ = null; - } - return sentencesBuilder_; - } - - private java.util.List tokens_ = - java.util.Collections.emptyList(); - - private void ensureTokensIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - tokens_ = new java.util.ArrayList(tokens_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Token, - com.google.cloud.language.v1.Token.Builder, - com.google.cloud.language.v1.TokenOrBuilder> - tokensBuilder_; - - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public java.util.List getTokensList() { - if (tokensBuilder_ == null) { - return java.util.Collections.unmodifiableList(tokens_); - } else { - return tokensBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public int getTokensCount() { - if (tokensBuilder_ == null) { - return tokens_.size(); - } else { - return tokensBuilder_.getCount(); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token getTokens(int index) { - if (tokensBuilder_ == null) { - return tokens_.get(index); - } else { - return tokensBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder setTokens(int index, com.google.cloud.language.v1.Token value) { - if (tokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTokensIsMutable(); - tokens_.set(index, value); - onChanged(); - } else { - tokensBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder setTokens( - int index, com.google.cloud.language.v1.Token.Builder builderForValue) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.set(index, builderForValue.build()); - onChanged(); - } else { - tokensBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens(com.google.cloud.language.v1.Token value) { - if (tokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTokensIsMutable(); - tokens_.add(value); - onChanged(); - } else { - tokensBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens(int index, com.google.cloud.language.v1.Token value) { - if (tokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTokensIsMutable(); - tokens_.add(index, value); - onChanged(); - } else { - tokensBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens(com.google.cloud.language.v1.Token.Builder builderForValue) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.add(builderForValue.build()); - onChanged(); - } else { - tokensBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addTokens( - int index, com.google.cloud.language.v1.Token.Builder builderForValue) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.add(index, builderForValue.build()); - onChanged(); - } else { - tokensBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder addAllTokens( - java.lang.Iterable values) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tokens_); - onChanged(); - } else { - tokensBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder clearTokens() { - if (tokensBuilder_ == null) { - tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - tokensBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public Builder removeTokens(int index) { - if (tokensBuilder_ == null) { - ensureTokensIsMutable(); - tokens_.remove(index); - onChanged(); - } else { - tokensBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token.Builder getTokensBuilder(int index) { - return getTokensFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) { - if (tokensBuilder_ == null) { - return tokens_.get(index); - } else { - return tokensBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public java.util.List - getTokensOrBuilderList() { - if (tokensBuilder_ != null) { - return tokensBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tokens_); - } - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token.Builder addTokensBuilder() { - return getTokensFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Token.getDefaultInstance()); - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public com.google.cloud.language.v1.Token.Builder addTokensBuilder(int index) { - return getTokensFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Token.getDefaultInstance()); - } - /** - * - * - *
-     * Tokens, along with their syntactic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-     * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - public java.util.List getTokensBuilderList() { - return getTokensFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Token, - com.google.cloud.language.v1.Token.Builder, - com.google.cloud.language.v1.TokenOrBuilder> - getTokensFieldBuilder() { - if (tokensBuilder_ == null) { - tokensBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Token, - com.google.cloud.language.v1.Token.Builder, - com.google.cloud.language.v1.TokenOrBuilder>( - tokens_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); - tokens_ = null; - } - return tokensBuilder_; - } - - private java.util.List entities_ = - java.util.Collections.emptyList(); - - private void ensureEntitiesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - entities_ = new java.util.ArrayList(entities_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder> - entitiesBuilder_; - - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public java.util.List getEntitiesList() { - if (entitiesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entities_); - } else { - return entitiesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public int getEntitiesCount() { - if (entitiesBuilder_ == null) { - return entities_.size(); - } else { - return entitiesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public com.google.cloud.language.v1.Entity getEntities(int index) { - if (entitiesBuilder_ == null) { - return entities_.get(index); - } else { - return entitiesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder setEntities(int index, com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.set(index, value); - onChanged(); - } else { - entitiesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder setEntities( - int index, com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.set(index, builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder addEntities(com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.add(value); - onChanged(); - } else { - entitiesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder addEntities(int index, com.google.cloud.language.v1.Entity value) { - if (entitiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntitiesIsMutable(); - entities_.add(index, value); - onChanged(); - } else { - entitiesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder addEntities(com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder addEntities( - int index, com.google.cloud.language.v1.Entity.Builder builderForValue) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.add(index, builderForValue.build()); - onChanged(); - } else { - entitiesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder addAllEntities( - java.lang.Iterable values) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entities_); - onChanged(); - } else { - entitiesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder clearEntities() { - if (entitiesBuilder_ == null) { - entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - entitiesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public Builder removeEntities(int index) { - if (entitiesBuilder_ == null) { - ensureEntitiesIsMutable(); - entities_.remove(index); - onChanged(); - } else { - entitiesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public com.google.cloud.language.v1.Entity.Builder getEntitiesBuilder(int index) { - return getEntitiesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index) { - if (entitiesBuilder_ == null) { - return entities_.get(index); - } else { - return entitiesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public java.util.List - getEntitiesOrBuilderList() { - if (entitiesBuilder_ != null) { - return entitiesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entities_); - } - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public com.google.cloud.language.v1.Entity.Builder addEntitiesBuilder() { - return getEntitiesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.Entity.getDefaultInstance()); - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public com.google.cloud.language.v1.Entity.Builder addEntitiesBuilder(int index) { - return getEntitiesFieldBuilder() - .addBuilder(index, com.google.cloud.language.v1.Entity.getDefaultInstance()); - } - /** - * - * - *
-     * Entities, along with their semantic information, in the input document.
-     * Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-     * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - public java.util.List getEntitiesBuilderList() { - return getEntitiesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder> - getEntitiesFieldBuilder() { - if (entitiesBuilder_ == null) { - entitiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.Entity, - com.google.cloud.language.v1.Entity.Builder, - com.google.cloud.language.v1.EntityOrBuilder>( - entities_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - entities_ = null; - } - return entitiesBuilder_; - } - - private com.google.cloud.language.v1.Sentiment documentSentiment_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Sentiment, - com.google.cloud.language.v1.Sentiment.Builder, - com.google.cloud.language.v1.SentimentOrBuilder> - documentSentimentBuilder_; - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - * - * @return Whether the documentSentiment field is set. - */ - public boolean hasDocumentSentiment() { - return documentSentimentBuilder_ != null || documentSentiment_ != null; - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - * - * @return The documentSentiment. - */ - public com.google.cloud.language.v1.Sentiment getDocumentSentiment() { - if (documentSentimentBuilder_ == null) { - return documentSentiment_ == null - ? com.google.cloud.language.v1.Sentiment.getDefaultInstance() - : documentSentiment_; - } else { - return documentSentimentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - public Builder setDocumentSentiment(com.google.cloud.language.v1.Sentiment value) { - if (documentSentimentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - documentSentiment_ = value; - onChanged(); - } else { - documentSentimentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - public Builder setDocumentSentiment( - com.google.cloud.language.v1.Sentiment.Builder builderForValue) { - if (documentSentimentBuilder_ == null) { - documentSentiment_ = builderForValue.build(); - onChanged(); - } else { - documentSentimentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - public Builder mergeDocumentSentiment(com.google.cloud.language.v1.Sentiment value) { - if (documentSentimentBuilder_ == null) { - if (documentSentiment_ != null) { - documentSentiment_ = - com.google.cloud.language.v1.Sentiment.newBuilder(documentSentiment_) - .mergeFrom(value) - .buildPartial(); - } else { - documentSentiment_ = value; - } - onChanged(); - } else { - documentSentimentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - public Builder clearDocumentSentiment() { - if (documentSentimentBuilder_ == null) { - documentSentiment_ = null; - onChanged(); - } else { - documentSentiment_ = null; - documentSentimentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - public com.google.cloud.language.v1.Sentiment.Builder getDocumentSentimentBuilder() { - - onChanged(); - return getDocumentSentimentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBuilder() { - if (documentSentimentBuilder_ != null) { - return documentSentimentBuilder_.getMessageOrBuilder(); - } else { - return documentSentiment_ == null - ? com.google.cloud.language.v1.Sentiment.getDefaultInstance() - : documentSentiment_; - } - } - /** - * - * - *
-     * The overall sentiment for the document. Populated if the user enables
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-     * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Sentiment, - com.google.cloud.language.v1.Sentiment.Builder, - com.google.cloud.language.v1.SentimentOrBuilder> - getDocumentSentimentFieldBuilder() { - if (documentSentimentBuilder_ == null) { - documentSentimentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Sentiment, - com.google.cloud.language.v1.Sentiment.Builder, - com.google.cloud.language.v1.SentimentOrBuilder>( - getDocumentSentiment(), getParentForChildren(), isClean()); - documentSentiment_ = null; - } - return documentSentimentBuilder_; - } - - private java.lang.Object language_ = ""; - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 5; - * - * @return The language. - */ - public java.lang.String getLanguage() { - java.lang.Object ref = language_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - language_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 5; - * - * @return The bytes for language. - */ - public com.google.protobuf.ByteString getLanguageBytes() { - java.lang.Object ref = language_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - language_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 5; - * - * @param value The language to set. - * @return This builder for chaining. - */ - public Builder setLanguage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - language_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 5; - * - * @return This builder for chaining. - */ - public Builder clearLanguage() { - - language_ = getDefaultInstance().getLanguage(); - onChanged(); - return this; - } - /** - * - * - *
-     * The language of the text, which will be the same as the language specified
-     * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-     * 
- * - * string language = 5; - * - * @param value The bytes for language to set. - * @return This builder for chaining. - */ - public Builder setLanguageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - language_ = value; - onChanged(); - return this; - } - - private java.util.List categories_ = - java.util.Collections.emptyList(); - - private void ensureCategoriesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - categories_ = - new java.util.ArrayList( - categories_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.ClassificationCategory, - com.google.cloud.language.v1.ClassificationCategory.Builder, - com.google.cloud.language.v1.ClassificationCategoryOrBuilder> - categoriesBuilder_; - - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public java.util.List getCategoriesList() { - if (categoriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(categories_); - } else { - return categoriesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public int getCategoriesCount() { - if (categoriesBuilder_ == null) { - return categories_.size(); - } else { - return categoriesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public com.google.cloud.language.v1.ClassificationCategory getCategories(int index) { - if (categoriesBuilder_ == null) { - return categories_.get(index); - } else { - return categoriesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder setCategories( - int index, com.google.cloud.language.v1.ClassificationCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.set(index, value); - onChanged(); - } else { - categoriesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder setCategories( - int index, com.google.cloud.language.v1.ClassificationCategory.Builder builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.set(index, builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder addCategories(com.google.cloud.language.v1.ClassificationCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.add(value); - onChanged(); - } else { - categoriesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder addCategories( - int index, com.google.cloud.language.v1.ClassificationCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.add(index, value); - onChanged(); - } else { - categoriesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder addCategories( - com.google.cloud.language.v1.ClassificationCategory.Builder builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder addCategories( - int index, com.google.cloud.language.v1.ClassificationCategory.Builder builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(index, builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder addAllCategories( - java.lang.Iterable values) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); - onChanged(); - } else { - categoriesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder clearCategories() { - if (categoriesBuilder_ == null) { - categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - categoriesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public Builder removeCategories(int index) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.remove(index); - onChanged(); - } else { - categoriesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public com.google.cloud.language.v1.ClassificationCategory.Builder getCategoriesBuilder( - int index) { - return getCategoriesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public com.google.cloud.language.v1.ClassificationCategoryOrBuilder getCategoriesOrBuilder( - int index) { - if (categoriesBuilder_ == null) { - return categories_.get(index); - } else { - return categoriesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public java.util.List - getCategoriesOrBuilderList() { - if (categoriesBuilder_ != null) { - return categoriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(categories_); - } - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public com.google.cloud.language.v1.ClassificationCategory.Builder addCategoriesBuilder() { - return getCategoriesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.ClassificationCategory.getDefaultInstance()); - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public com.google.cloud.language.v1.ClassificationCategory.Builder addCategoriesBuilder( - int index) { - return getCategoriesFieldBuilder() - .addBuilder( - index, com.google.cloud.language.v1.ClassificationCategory.getDefaultInstance()); - } - /** - * - * - *
-     * Categories identified in the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - public java.util.List - getCategoriesBuilderList() { - return getCategoriesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.ClassificationCategory, - com.google.cloud.language.v1.ClassificationCategory.Builder, - com.google.cloud.language.v1.ClassificationCategoryOrBuilder> - getCategoriesFieldBuilder() { - if (categoriesBuilder_ == null) { - categoriesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.ClassificationCategory, - com.google.cloud.language.v1.ClassificationCategory.Builder, - com.google.cloud.language.v1.ClassificationCategoryOrBuilder>( - categories_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); - categories_ = null; - } - return categoriesBuilder_; - } - - @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.language.v1.AnnotateTextResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnnotateTextResponse) - private static final com.google.cloud.language.v1.AnnotateTextResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnnotateTextResponse(); - } - - public static com.google.cloud.language.v1.AnnotateTextResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnnotateTextResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.AnnotateTextResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java deleted file mode 100644 index 42ca1b94..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface AnnotateTextResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnnotateTextResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - java.util.List getSentencesList(); - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - com.google.cloud.language.v1.Sentence getSentences(int index); - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - int getSentencesCount(); - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - java.util.List - getSentencesOrBuilderList(); - /** - * - * - *
-   * Sentences in the input document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Sentence sentences = 1; - */ - com.google.cloud.language.v1.SentenceOrBuilder getSentencesOrBuilder(int index); - - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - java.util.List getTokensList(); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - com.google.cloud.language.v1.Token getTokens(int index); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - int getTokensCount(); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - java.util.List getTokensOrBuilderList(); - /** - * - * - *
-   * Tokens, along with their syntactic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
-   * 
- * - * repeated .google.cloud.language.v1.Token tokens = 2; - */ - com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index); - - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - java.util.List getEntitiesList(); - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - com.google.cloud.language.v1.Entity getEntities(int index); - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - int getEntitiesCount(); - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - java.util.List getEntitiesOrBuilderList(); - /** - * - * - *
-   * Entities, along with their semantic information, in the input document.
-   * Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
-   * 
- * - * repeated .google.cloud.language.v1.Entity entities = 3; - */ - com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int index); - - /** - * - * - *
-   * The overall sentiment for the document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - * - * @return Whether the documentSentiment field is set. - */ - boolean hasDocumentSentiment(); - /** - * - * - *
-   * The overall sentiment for the document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - * - * @return The documentSentiment. - */ - com.google.cloud.language.v1.Sentiment getDocumentSentiment(); - /** - * - * - *
-   * The overall sentiment for the document. Populated if the user enables
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
-   * 
- * - * .google.cloud.language.v1.Sentiment document_sentiment = 4; - */ - com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBuilder(); - - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 5; - * - * @return The language. - */ - java.lang.String getLanguage(); - /** - * - * - *
-   * The language of the text, which will be the same as the language specified
-   * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
-   * 
- * - * string language = 5; - * - * @return The bytes for language. - */ - com.google.protobuf.ByteString getLanguageBytes(); - - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - java.util.List getCategoriesList(); - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - com.google.cloud.language.v1.ClassificationCategory getCategories(int index); - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - int getCategoriesCount(); - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - java.util.List - getCategoriesOrBuilderList(); - /** - * - * - *
-   * Categories identified in the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 6; - */ - com.google.cloud.language.v1.ClassificationCategoryOrBuilder getCategoriesOrBuilder(int index); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java deleted file mode 100644 index 0d385a3e..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategory.java +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * Represents a category returned from the text classifier.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationCategory} - */ -public final class ClassificationCategory extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationCategory) - ClassificationCategoryOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassificationCategory.newBuilder() to construct. - private ClassificationCategory(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ClassificationCategory() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClassificationCategory(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationCategory_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationCategory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationCategory.class, - com.google.cloud.language.v1.ClassificationCategory.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * The name of the category representing the document, from the [predefined
-   * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-   * 
- * - * string name = 1; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the category representing the document, from the [predefined
-   * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 2; - private float confidence_; - /** - * - * - *
-   * The classifier's confidence of the category. Number represents how certain
-   * the classifier is that this category represents the given text.
-   * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - @java.lang.Override - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - output.writeFloat(2, confidence_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.ClassificationCategory)) { - return super.equals(obj); - } - com.google.cloud.language.v1.ClassificationCategory other = - (com.google.cloud.language.v1.ClassificationCategory) obj; - - if (!getName().equals(other.getName())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits(other.getConfidence())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.ClassificationCategory parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationCategory 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.language.v1.ClassificationCategory parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationCategory 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.language.v1.ClassificationCategory parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationCategory parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.ClassificationCategory parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationCategory 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.language.v1.ClassificationCategory parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationCategory 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.language.v1.ClassificationCategory parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationCategory 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.language.v1.ClassificationCategory 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; - } - /** - * - * - *
-   * Represents a category returned from the text classifier.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationCategory} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationCategory) - com.google.cloud.language.v1.ClassificationCategoryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationCategory_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationCategory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationCategory.class, - com.google.cloud.language.v1.ClassificationCategory.Builder.class); - } - - // Construct using com.google.cloud.language.v1.ClassificationCategory.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - confidence_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationCategory_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategory getDefaultInstanceForType() { - return com.google.cloud.language.v1.ClassificationCategory.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategory build() { - com.google.cloud.language.v1.ClassificationCategory result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategory buildPartial() { - com.google.cloud.language.v1.ClassificationCategory result = - new com.google.cloud.language.v1.ClassificationCategory(this); - result.name_ = name_; - result.confidence_ = confidence_; - 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.language.v1.ClassificationCategory) { - return mergeFrom((com.google.cloud.language.v1.ClassificationCategory) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.ClassificationCategory other) { - if (other == com.google.cloud.language.v1.ClassificationCategory.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - - break; - } // case 10 - case 21: - { - confidence_ = input.readFloat(); - - break; - } // case 21 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * The name of the category representing the document, from the [predefined
-     * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-     * 
- * - * string name = 1; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the category representing the document, from the [predefined
-     * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-     * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the category representing the document, from the [predefined
-     * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-     * 
- * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the category representing the document, from the [predefined
-     * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-     * 
- * - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the category representing the document, from the [predefined
-     * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-     * 
- * - * 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_; - /** - * - * - *
-     * The classifier's confidence of the category. Number represents how certain
-     * the classifier is that this category represents the given text.
-     * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - * - * - *
-     * The classifier's confidence of the category. Number represents how certain
-     * the classifier is that this category represents the given text.
-     * 
- * - * float confidence = 2; - * - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The classifier's confidence of the category. Number represents how certain
-     * the classifier is that this category represents the given text.
-     * 
- * - * float confidence = 2; - * - * @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.language.v1.ClassificationCategory) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationCategory) - private static final com.google.cloud.language.v1.ClassificationCategory DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationCategory(); - } - - public static com.google.cloud.language.v1.ClassificationCategory getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassificationCategory parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategory getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategoryOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategoryOrBuilder.java deleted file mode 100644 index 1dd70380..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationCategoryOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface ClassificationCategoryOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationCategory) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The name of the category representing the document, from the [predefined
-   * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-   * 
- * - * string name = 1; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * The name of the category representing the document, from the [predefined
-   * taxonomy](https://cloud.google.com/natural-language/docs/categories).
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * The classifier's confidence of the category. Number represents how certain
-   * the classifier is that this category represents the given text.
-   * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - float getConfidence(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java deleted file mode 100644 index 3af41654..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java +++ /dev/null @@ -1,2417 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * Model options available for classification requests.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions} - */ -public final class ClassificationModelOptions extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions) - ClassificationModelOptionsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassificationModelOptions.newBuilder() to construct. - private ClassificationModelOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ClassificationModelOptions() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClassificationModelOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationModelOptions.class, - com.google.cloud.language.v1.ClassificationModelOptions.Builder.class); - } - - public interface V1ModelOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions.V1Model) - com.google.protobuf.MessageOrBuilder {} - /** - * - * - *
-   * Options for the V1 model.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V1Model} - */ - public static final class V1Model extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions.V1Model) - V1ModelOrBuilder { - private static final long serialVersionUID = 0L; - // Use V1Model.newBuilder() to construct. - private V1Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private V1Model() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new V1Model(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.class, - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder.class); - } - - 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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.ClassificationModelOptions.V1Model)) { - return super.equals(obj); - } - com.google.cloud.language.v1.ClassificationModelOptions.V1Model other = - (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model - 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.language.v1.ClassificationModelOptions.V1Model parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model 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.language.v1.ClassificationModelOptions.V1Model 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; - } - /** - * - * - *
-     * Options for the V1 model.
-     * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V1Model} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions.V1Model) - com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.class, - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder.class); - } - - // Construct using - // com.google.cloud.language.v1.ClassificationModelOptions.V1Model.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model - getDefaultInstanceForType() { - return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model build() { - com.google.cloud.language.v1.ClassificationModelOptions.V1Model result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model buildPartial() { - com.google.cloud.language.v1.ClassificationModelOptions.V1Model result = - new com.google.cloud.language.v1.ClassificationModelOptions.V1Model(this); - 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.language.v1.ClassificationModelOptions.V1Model) { - return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions.V1Model) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model other) { - if (other - == com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance()) - return this; - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - @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.language.v1.ClassificationModelOptions.V1Model) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions.V1Model) - private static final com.google.cloud.language.v1.ClassificationModelOptions.V1Model - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions.V1Model(); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public V1Model parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface V2ModelOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions.V2Model) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The content categories used for classification.
-     * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return The enum numeric value on the wire for contentCategoriesVersion. - */ - int getContentCategoriesVersionValue(); - /** - * - * - *
-     * The content categories used for classification.
-     * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return The contentCategoriesVersion. - */ - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion - getContentCategoriesVersion(); - } - /** - * - * - *
-   * Options for the V2 model.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V2Model} - */ - public static final class V2Model extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions.V2Model) - V2ModelOrBuilder { - private static final long serialVersionUID = 0L; - // Use V2Model.newBuilder() to construct. - private V2Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private V2Model() { - contentCategoriesVersion_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new V2Model(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.class, - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder.class); - } - - /** - * - * - *
-     * The content categories used for classification.
-     * 
- * - * Protobuf enum {@code - * google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion} - */ - public enum ContentCategoriesVersion implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * If `ContentCategoriesVersion` is not specified, this option will
-       * default to `V1`.
-       * 
- * - * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; - */ - CONTENT_CATEGORIES_VERSION_UNSPECIFIED(0), - /** - * - * - *
-       * Legacy content categories of our initial launch in 2017.
-       * 
- * - * V1 = 1; - */ - V1(1), - /** - * - * - *
-       * Updated content categories in 2022.
-       * 
- * - * V2 = 2; - */ - V2(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-       * If `ContentCategoriesVersion` is not specified, this option will
-       * default to `V1`.
-       * 
- * - * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; - */ - public static final int CONTENT_CATEGORIES_VERSION_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * Legacy content categories of our initial launch in 2017.
-       * 
- * - * V1 = 1; - */ - public static final int V1_VALUE = 1; - /** - * - * - *
-       * Updated content categories in 2022.
-       * 
- * - * V2 = 2; - */ - public static final int V2_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ContentCategoriesVersion 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 ContentCategoriesVersion forNumber(int value) { - switch (value) { - case 0: - return CONTENT_CATEGORIES_VERSION_UNSPECIFIED; - case 1: - return V1; - case 2: - return V2; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ContentCategoriesVersion findValueByNumber(int number) { - return ContentCategoriesVersion.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final ContentCategoriesVersion[] VALUES = values(); - - public static ContentCategoriesVersion valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private ContentCategoriesVersion(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion) - } - - public static final int CONTENT_CATEGORIES_VERSION_FIELD_NUMBER = 1; - private int contentCategoriesVersion_; - /** - * - * - *
-     * The content categories used for classification.
-     * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return The enum numeric value on the wire for contentCategoriesVersion. - */ - @java.lang.Override - public int getContentCategoriesVersionValue() { - return contentCategoriesVersion_; - } - /** - * - * - *
-     * The content categories used for classification.
-     * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return The contentCategoriesVersion. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion - getContentCategoriesVersion() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion - result = - com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); - return result == null - ? com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion - .UNRECOGNIZED - : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contentCategoriesVersion_ - != com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, contentCategoriesVersion_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (contentCategoriesVersion_ - != com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.ClassificationModelOptions.V2Model)) { - return super.equals(obj); - } - com.google.cloud.language.v1.ClassificationModelOptions.V2Model other = - (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) obj; - - if (contentCategoriesVersion_ != other.contentCategoriesVersion_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; - hash = (53 * hash) + contentCategoriesVersion_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model - 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.language.v1.ClassificationModelOptions.V2Model parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model 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.language.v1.ClassificationModelOptions.V2Model 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; - } - /** - * - * - *
-     * Options for the V2 model.
-     * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V2Model} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions.V2Model) - com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.class, - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder.class); - } - - // Construct using - // com.google.cloud.language.v1.ClassificationModelOptions.V2Model.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - contentCategoriesVersion_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model - getDefaultInstanceForType() { - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model build() { - com.google.cloud.language.v1.ClassificationModelOptions.V2Model result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model buildPartial() { - com.google.cloud.language.v1.ClassificationModelOptions.V2Model result = - new com.google.cloud.language.v1.ClassificationModelOptions.V2Model(this); - result.contentCategoriesVersion_ = contentCategoriesVersion_; - 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.language.v1.ClassificationModelOptions.V2Model) { - return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions.V2Model) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model other) { - if (other - == com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance()) - return this; - if (other.contentCategoriesVersion_ != 0) { - setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - contentCategoriesVersion_ = input.readEnum(); - - break; - } // case 8 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int contentCategoriesVersion_ = 0; - /** - * - * - *
-       * The content categories used for classification.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return The enum numeric value on the wire for contentCategoriesVersion. - */ - @java.lang.Override - public int getContentCategoriesVersionValue() { - return contentCategoriesVersion_; - } - /** - * - * - *
-       * The content categories used for classification.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @param value The enum numeric value on the wire for contentCategoriesVersion to set. - * @return This builder for chaining. - */ - public Builder setContentCategoriesVersionValue(int value) { - - contentCategoriesVersion_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The content categories used for classification.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return The contentCategoriesVersion. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .ContentCategoriesVersion - getContentCategoriesVersion() { - @SuppressWarnings("deprecation") - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion - result = - com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); - return result == null - ? com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .ContentCategoriesVersion.UNRECOGNIZED - : result; - } - /** - * - * - *
-       * The content categories used for classification.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @param value The contentCategoriesVersion to set. - * @return This builder for chaining. - */ - public Builder setContentCategoriesVersion( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion - value) { - if (value == null) { - throw new NullPointerException(); - } - - contentCategoriesVersion_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * The content categories used for classification.
-       * 
- * - * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; - * - * - * @return This builder for chaining. - */ - public Builder clearContentCategoriesVersion() { - - contentCategoriesVersion_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model) - private static final com.google.cloud.language.v1.ClassificationModelOptions.V2Model - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions.V2Model(); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public V2Model parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int modelTypeCase_ = 0; - private java.lang.Object modelType_; - - public enum ModelTypeCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - V1_MODEL(1), - V2_MODEL(2), - MODELTYPE_NOT_SET(0); - private final int value; - - private ModelTypeCase(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 ModelTypeCase valueOf(int value) { - return forNumber(value); - } - - public static ModelTypeCase forNumber(int value) { - switch (value) { - case 1: - return V1_MODEL; - case 2: - return V2_MODEL; - case 0: - return MODELTYPE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public ModelTypeCase getModelTypeCase() { - return ModelTypeCase.forNumber(modelTypeCase_); - } - - public static final int V1_MODEL_FIELD_NUMBER = 1; - /** - * - * - *
-   * Setting this field will use the V1 model and V1 content categories
-   * version. The V1 model is a legacy model; support for this will be
-   * discontinued in the future.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - * - * @return Whether the v1Model field is set. - */ - @java.lang.Override - public boolean hasV1Model() { - return modelTypeCase_ == 1; - } - /** - * - * - *
-   * Setting this field will use the V1 model and V1 content categories
-   * version. The V1 model is a legacy model; support for this will be
-   * discontinued in the future.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - * - * @return The v1Model. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model() { - if (modelTypeCase_ == 1) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } - /** - * - * - *
-   * Setting this field will use the V1 model and V1 content categories
-   * version. The V1 model is a legacy model; support for this will be
-   * discontinued in the future.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder - getV1ModelOrBuilder() { - if (modelTypeCase_ == 1) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } - - public static final int V2_MODEL_FIELD_NUMBER = 2; - /** - * - * - *
-   * Setting this field will use the V2 model with the appropriate content
-   * categories version. The V2 model is a better performing model.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - * - * @return Whether the v2Model field is set. - */ - @java.lang.Override - public boolean hasV2Model() { - return modelTypeCase_ == 2; - } - /** - * - * - *
-   * Setting this field will use the V2 model with the appropriate content
-   * categories version. The V2 model is a better performing model.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - * - * @return The v2Model. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model() { - if (modelTypeCase_ == 2) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } - /** - * - * - *
-   * Setting this field will use the V2 model with the appropriate content
-   * categories version. The V2 model is a better performing model.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder - getV2ModelOrBuilder() { - if (modelTypeCase_ == 2) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } - - 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 (modelTypeCase_ == 1) { - output.writeMessage( - 1, (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); - } - if (modelTypeCase_ == 2) { - output.writeMessage( - 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (modelTypeCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); - } - if (modelTypeCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.ClassificationModelOptions)) { - return super.equals(obj); - } - com.google.cloud.language.v1.ClassificationModelOptions other = - (com.google.cloud.language.v1.ClassificationModelOptions) obj; - - if (!getModelTypeCase().equals(other.getModelTypeCase())) return false; - switch (modelTypeCase_) { - case 1: - if (!getV1Model().equals(other.getV1Model())) return false; - break; - case 2: - if (!getV2Model().equals(other.getV2Model())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (modelTypeCase_) { - case 1: - hash = (37 * hash) + V1_MODEL_FIELD_NUMBER; - hash = (53 * hash) + getV1Model().hashCode(); - break; - case 2: - hash = (37 * hash) + V2_MODEL_FIELD_NUMBER; - hash = (53 * hash) + getV2Model().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions 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.language.v1.ClassificationModelOptions 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; - } - /** - * - * - *
-   * Model options available for classification requests.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions) - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassificationModelOptions.class, - com.google.cloud.language.v1.ClassificationModelOptions.Builder.class); - } - - // Construct using com.google.cloud.language.v1.ClassificationModelOptions.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (v1ModelBuilder_ != null) { - v1ModelBuilder_.clear(); - } - if (v2ModelBuilder_ != null) { - v2ModelBuilder_.clear(); - } - modelTypeCase_ = 0; - modelType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstanceForType() { - return com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions build() { - com.google.cloud.language.v1.ClassificationModelOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions buildPartial() { - com.google.cloud.language.v1.ClassificationModelOptions result = - new com.google.cloud.language.v1.ClassificationModelOptions(this); - if (modelTypeCase_ == 1) { - if (v1ModelBuilder_ == null) { - result.modelType_ = modelType_; - } else { - result.modelType_ = v1ModelBuilder_.build(); - } - } - if (modelTypeCase_ == 2) { - if (v2ModelBuilder_ == null) { - result.modelType_ = modelType_; - } else { - result.modelType_ = v2ModelBuilder_.build(); - } - } - result.modelTypeCase_ = modelTypeCase_; - 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.language.v1.ClassificationModelOptions) { - return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.ClassificationModelOptions other) { - if (other == com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance()) - return this; - switch (other.getModelTypeCase()) { - case V1_MODEL: - { - mergeV1Model(other.getV1Model()); - break; - } - case V2_MODEL: - { - mergeV2Model(other.getV2Model()); - break; - } - case MODELTYPE_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getV1ModelFieldBuilder().getBuilder(), extensionRegistry); - modelTypeCase_ = 1; - break; - } // case 10 - case 18: - { - input.readMessage(getV2ModelFieldBuilder().getBuilder(), extensionRegistry); - modelTypeCase_ = 2; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int modelTypeCase_ = 0; - private java.lang.Object modelType_; - - public ModelTypeCase getModelTypeCase() { - return ModelTypeCase.forNumber(modelTypeCase_); - } - - public Builder clearModelType() { - modelTypeCase_ = 0; - modelType_ = null; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions.V1Model, - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, - com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder> - v1ModelBuilder_; - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - * - * @return Whether the v1Model field is set. - */ - @java.lang.Override - public boolean hasV1Model() { - return modelTypeCase_ == 1; - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - * - * @return The v1Model. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model() { - if (v1ModelBuilder_ == null) { - if (modelTypeCase_ == 1) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } else { - if (modelTypeCase_ == 1) { - return v1ModelBuilder_.getMessage(); - } - return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - public Builder setV1Model( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model value) { - if (v1ModelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - modelType_ = value; - onChanged(); - } else { - v1ModelBuilder_.setMessage(value); - } - modelTypeCase_ = 1; - return this; - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - public Builder setV1Model( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder builderForValue) { - if (v1ModelBuilder_ == null) { - modelType_ = builderForValue.build(); - onChanged(); - } else { - v1ModelBuilder_.setMessage(builderForValue.build()); - } - modelTypeCase_ = 1; - return this; - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - public Builder mergeV1Model( - com.google.cloud.language.v1.ClassificationModelOptions.V1Model value) { - if (v1ModelBuilder_ == null) { - if (modelTypeCase_ == 1 - && modelType_ - != com.google.cloud.language.v1.ClassificationModelOptions.V1Model - .getDefaultInstance()) { - modelType_ = - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.newBuilder( - (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_) - .mergeFrom(value) - .buildPartial(); - } else { - modelType_ = value; - } - onChanged(); - } else { - if (modelTypeCase_ == 1) { - v1ModelBuilder_.mergeFrom(value); - } else { - v1ModelBuilder_.setMessage(value); - } - } - modelTypeCase_ = 1; - return this; - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - public Builder clearV1Model() { - if (v1ModelBuilder_ == null) { - if (modelTypeCase_ == 1) { - modelTypeCase_ = 0; - modelType_ = null; - onChanged(); - } - } else { - if (modelTypeCase_ == 1) { - modelTypeCase_ = 0; - modelType_ = null; - } - v1ModelBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - public com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder - getV1ModelBuilder() { - return getV1ModelFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder - getV1ModelOrBuilder() { - if ((modelTypeCase_ == 1) && (v1ModelBuilder_ != null)) { - return v1ModelBuilder_.getMessageOrBuilder(); - } else { - if (modelTypeCase_ == 1) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } - } - /** - * - * - *
-     * Setting this field will use the V1 model and V1 content categories
-     * version. The V1 model is a legacy model; support for this will be
-     * discontinued in the future.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions.V1Model, - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, - com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder> - getV1ModelFieldBuilder() { - if (v1ModelBuilder_ == null) { - if (!(modelTypeCase_ == 1)) { - modelType_ = - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); - } - v1ModelBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions.V1Model, - com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, - com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder>( - (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_, - getParentForChildren(), - isClean()); - modelType_ = null; - } - modelTypeCase_ = 1; - onChanged(); - ; - return v1ModelBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions.V2Model, - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, - com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder> - v2ModelBuilder_; - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - * - * @return Whether the v2Model field is set. - */ - @java.lang.Override - public boolean hasV2Model() { - return modelTypeCase_ == 2; - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - * - * @return The v2Model. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model() { - if (v2ModelBuilder_ == null) { - if (modelTypeCase_ == 2) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } else { - if (modelTypeCase_ == 2) { - return v2ModelBuilder_.getMessage(); - } - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - public Builder setV2Model( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model value) { - if (v2ModelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - modelType_ = value; - onChanged(); - } else { - v2ModelBuilder_.setMessage(value); - } - modelTypeCase_ = 2; - return this; - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - public Builder setV2Model( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder builderForValue) { - if (v2ModelBuilder_ == null) { - modelType_ = builderForValue.build(); - onChanged(); - } else { - v2ModelBuilder_.setMessage(builderForValue.build()); - } - modelTypeCase_ = 2; - return this; - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - public Builder mergeV2Model( - com.google.cloud.language.v1.ClassificationModelOptions.V2Model value) { - if (v2ModelBuilder_ == null) { - if (modelTypeCase_ == 2 - && modelType_ - != com.google.cloud.language.v1.ClassificationModelOptions.V2Model - .getDefaultInstance()) { - modelType_ = - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.newBuilder( - (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_) - .mergeFrom(value) - .buildPartial(); - } else { - modelType_ = value; - } - onChanged(); - } else { - if (modelTypeCase_ == 2) { - v2ModelBuilder_.mergeFrom(value); - } else { - v2ModelBuilder_.setMessage(value); - } - } - modelTypeCase_ = 2; - return this; - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - public Builder clearV2Model() { - if (v2ModelBuilder_ == null) { - if (modelTypeCase_ == 2) { - modelTypeCase_ = 0; - modelType_ = null; - onChanged(); - } - } else { - if (modelTypeCase_ == 2) { - modelTypeCase_ = 0; - modelType_ = null; - } - v2ModelBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - public com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder - getV2ModelBuilder() { - return getV2ModelFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder - getV2ModelOrBuilder() { - if ((modelTypeCase_ == 2) && (v2ModelBuilder_ != null)) { - return v2ModelBuilder_.getMessageOrBuilder(); - } else { - if (modelTypeCase_ == 2) { - return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; - } - return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } - } - /** - * - * - *
-     * Setting this field will use the V2 model with the appropriate content
-     * categories version. The V2 model is a better performing model.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions.V2Model, - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, - com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder> - getV2ModelFieldBuilder() { - if (v2ModelBuilder_ == null) { - if (!(modelTypeCase_ == 2)) { - modelType_ = - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); - } - v2ModelBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions.V2Model, - com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, - com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder>( - (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_, - getParentForChildren(), - isClean()); - modelType_ = null; - } - modelTypeCase_ = 2; - onChanged(); - ; - return v2ModelBuilder_; - } - - @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.language.v1.ClassificationModelOptions) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions) - private static final com.google.cloud.language.v1.ClassificationModelOptions DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions(); - } - - public static com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassificationModelOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java deleted file mode 100644 index 852a2579..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface ClassificationModelOptionsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Setting this field will use the V1 model and V1 content categories
-   * version. The V1 model is a legacy model; support for this will be
-   * discontinued in the future.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - * - * @return Whether the v1Model field is set. - */ - boolean hasV1Model(); - /** - * - * - *
-   * Setting this field will use the V1 model and V1 content categories
-   * version. The V1 model is a legacy model; support for this will be
-   * discontinued in the future.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - * - * @return The v1Model. - */ - com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model(); - /** - * - * - *
-   * Setting this field will use the V1 model and V1 content categories
-   * version. The V1 model is a legacy model; support for this will be
-   * discontinued in the future.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; - */ - com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder getV1ModelOrBuilder(); - - /** - * - * - *
-   * Setting this field will use the V2 model with the appropriate content
-   * categories version. The V2 model is a better performing model.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - * - * @return Whether the v2Model field is set. - */ - boolean hasV2Model(); - /** - * - * - *
-   * Setting this field will use the V2 model with the appropriate content
-   * categories version. The V2 model is a better performing model.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - * - * @return The v2Model. - */ - com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model(); - /** - * - * - *
-   * Setting this field will use the V2 model with the appropriate content
-   * categories version. The V2 model is a better performing model.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; - */ - com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder getV2ModelOrBuilder(); - - public com.google.cloud.language.v1.ClassificationModelOptions.ModelTypeCase getModelTypeCase(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java deleted file mode 100644 index ec488de6..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java +++ /dev/null @@ -1,1029 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The document classification request message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassifyTextRequest} - */ -public final class ClassifyTextRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassifyTextRequest) - ClassifyTextRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassifyTextRequest.newBuilder() to construct. - private ClassifyTextRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ClassifyTextRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClassifyTextRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassifyTextRequest.class, - com.google.cloud.language.v1.ClassifyTextRequest.Builder.class); - } - - public static final int DOCUMENT_FIELD_NUMBER = 1; - private com.google.cloud.language.v1.Document document_; - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - @java.lang.Override - public boolean hasDocument() { - return document_ != null; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - @java.lang.Override - public com.google.cloud.language.v1.Document getDocument() { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - return getDocument(); - } - - public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 3; - private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; - /** - * - * - *
-   * Model options to use for classification. Defaults to v1 options if not
-   * specified.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - * - * @return Whether the classificationModelOptions field is set. - */ - @java.lang.Override - public boolean hasClassificationModelOptions() { - return classificationModelOptions_ != null; - } - /** - * - * - *
-   * Model options to use for classification. Defaults to v1 options if not
-   * specified.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - * - * @return The classificationModelOptions. - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { - return classificationModelOptions_ == null - ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() - : classificationModelOptions_; - } - /** - * - * - *
-   * Model options to use for classification. Defaults to v1 options if not
-   * specified.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder - getClassificationModelOptionsOrBuilder() { - return getClassificationModelOptions(); - } - - 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 (document_ != null) { - output.writeMessage(1, getDocument()); - } - if (classificationModelOptions_ != null) { - output.writeMessage(3, getClassificationModelOptions()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (document_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); - } - if (classificationModelOptions_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 3, getClassificationModelOptions()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.ClassifyTextRequest)) { - return super.equals(obj); - } - com.google.cloud.language.v1.ClassifyTextRequest other = - (com.google.cloud.language.v1.ClassifyTextRequest) obj; - - if (hasDocument() != other.hasDocument()) return false; - if (hasDocument()) { - if (!getDocument().equals(other.getDocument())) return false; - } - if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; - if (hasClassificationModelOptions()) { - if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDocument()) { - hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; - hash = (53 * hash) + getDocument().hashCode(); - } - if (hasClassificationModelOptions()) { - hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getClassificationModelOptions().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.ClassifyTextRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest 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.language.v1.ClassifyTextRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest 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.language.v1.ClassifyTextRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest 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.language.v1.ClassifyTextRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest 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.language.v1.ClassifyTextRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest 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.language.v1.ClassifyTextRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The document classification request message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassifyTextRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassifyTextRequest) - com.google.cloud.language.v1.ClassifyTextRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassifyTextRequest.class, - com.google.cloud.language.v1.ClassifyTextRequest.Builder.class); - } - - // Construct using com.google.cloud.language.v1.ClassifyTextRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (documentBuilder_ == null) { - document_ = null; - } else { - document_ = null; - documentBuilder_ = null; - } - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptions_ = null; - } else { - classificationModelOptions_ = null; - classificationModelOptionsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextRequest getDefaultInstanceForType() { - return com.google.cloud.language.v1.ClassifyTextRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextRequest build() { - com.google.cloud.language.v1.ClassifyTextRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextRequest buildPartial() { - com.google.cloud.language.v1.ClassifyTextRequest result = - new com.google.cloud.language.v1.ClassifyTextRequest(this); - if (documentBuilder_ == null) { - result.document_ = document_; - } else { - result.document_ = documentBuilder_.build(); - } - if (classificationModelOptionsBuilder_ == null) { - result.classificationModelOptions_ = classificationModelOptions_; - } else { - result.classificationModelOptions_ = classificationModelOptionsBuilder_.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.language.v1.ClassifyTextRequest) { - return mergeFrom((com.google.cloud.language.v1.ClassifyTextRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.ClassifyTextRequest other) { - if (other == com.google.cloud.language.v1.ClassifyTextRequest.getDefaultInstance()) - return this; - if (other.hasDocument()) { - mergeDocument(other.getDocument()); - } - if (other.hasClassificationModelOptions()) { - mergeClassificationModelOptions(other.getClassificationModelOptions()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 10 - case 26: - { - input.readMessage( - getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); - - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private com.google.cloud.language.v1.Document document_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - documentBuilder_; - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - public boolean hasDocument() { - return documentBuilder_ != null || document_ != null; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - public com.google.cloud.language.v1.Document getDocument() { - if (documentBuilder_ == null) { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } else { - return documentBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - document_ = value; - onChanged(); - } else { - documentBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { - if (documentBuilder_ == null) { - document_ = builderForValue.build(); - onChanged(); - } else { - documentBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeDocument(com.google.cloud.language.v1.Document value) { - if (documentBuilder_ == null) { - if (document_ != null) { - document_ = - com.google.cloud.language.v1.Document.newBuilder(document_) - .mergeFrom(value) - .buildPartial(); - } else { - document_ = value; - } - onChanged(); - } else { - documentBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearDocument() { - if (documentBuilder_ == null) { - document_ = null; - onChanged(); - } else { - document_ = null; - documentBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { - - onChanged(); - return getDocumentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { - if (documentBuilder_ != null) { - return documentBuilder_.getMessageOrBuilder(); - } else { - return document_ == null - ? com.google.cloud.language.v1.Document.getDefaultInstance() - : document_; - } - } - /** - * - * - *
-     * Required. Input document.
-     * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder> - getDocumentFieldBuilder() { - if (documentBuilder_ == null) { - documentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.Document, - com.google.cloud.language.v1.Document.Builder, - com.google.cloud.language.v1.DocumentOrBuilder>( - getDocument(), getParentForChildren(), isClean()); - document_ = null; - } - return documentBuilder_; - } - - private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions, - com.google.cloud.language.v1.ClassificationModelOptions.Builder, - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> - classificationModelOptionsBuilder_; - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - * - * @return Whether the classificationModelOptions field is set. - */ - public boolean hasClassificationModelOptions() { - return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - * - * @return The classificationModelOptions. - */ - public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { - if (classificationModelOptionsBuilder_ == null) { - return classificationModelOptions_ == null - ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() - : classificationModelOptions_; - } else { - return classificationModelOptionsBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - public Builder setClassificationModelOptions( - com.google.cloud.language.v1.ClassificationModelOptions value) { - if (classificationModelOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - classificationModelOptions_ = value; - onChanged(); - } else { - classificationModelOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - public Builder setClassificationModelOptions( - com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptions_ = builderForValue.build(); - onChanged(); - } else { - classificationModelOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - public Builder mergeClassificationModelOptions( - com.google.cloud.language.v1.ClassificationModelOptions value) { - if (classificationModelOptionsBuilder_ == null) { - if (classificationModelOptions_ != null) { - classificationModelOptions_ = - com.google.cloud.language.v1.ClassificationModelOptions.newBuilder( - classificationModelOptions_) - .mergeFrom(value) - .buildPartial(); - } else { - classificationModelOptions_ = value; - } - onChanged(); - } else { - classificationModelOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - public Builder clearClassificationModelOptions() { - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptions_ = null; - onChanged(); - } else { - classificationModelOptions_ = null; - classificationModelOptionsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - public com.google.cloud.language.v1.ClassificationModelOptions.Builder - getClassificationModelOptionsBuilder() { - - onChanged(); - return getClassificationModelOptionsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder - getClassificationModelOptionsOrBuilder() { - if (classificationModelOptionsBuilder_ != null) { - return classificationModelOptionsBuilder_.getMessageOrBuilder(); - } else { - return classificationModelOptions_ == null - ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() - : classificationModelOptions_; - } - } - /** - * - * - *
-     * Model options to use for classification. Defaults to v1 options if not
-     * specified.
-     * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions, - com.google.cloud.language.v1.ClassificationModelOptions.Builder, - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> - getClassificationModelOptionsFieldBuilder() { - if (classificationModelOptionsBuilder_ == null) { - classificationModelOptionsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.language.v1.ClassificationModelOptions, - com.google.cloud.language.v1.ClassificationModelOptions.Builder, - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( - getClassificationModelOptions(), getParentForChildren(), isClean()); - classificationModelOptions_ = null; - } - return classificationModelOptionsBuilder_; - } - - @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.language.v1.ClassifyTextRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassifyTextRequest) - private static final com.google.cloud.language.v1.ClassifyTextRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassifyTextRequest(); - } - - public static com.google.cloud.language.v1.ClassifyTextRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassifyTextRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java deleted file mode 100644 index 087944f5..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface ClassifyTextRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassifyTextRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the document field is set. - */ - boolean hasDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The document. - */ - com.google.cloud.language.v1.Document getDocument(); - /** - * - * - *
-   * Required. Input document.
-   * 
- * - * - * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); - - /** - * - * - *
-   * Model options to use for classification. Defaults to v1 options if not
-   * specified.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - * - * @return Whether the classificationModelOptions field is set. - */ - boolean hasClassificationModelOptions(); - /** - * - * - *
-   * Model options to use for classification. Defaults to v1 options if not
-   * specified.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - * - * @return The classificationModelOptions. - */ - com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); - /** - * - * - *
-   * Model options to use for classification. Defaults to v1 options if not
-   * specified.
-   * 
- * - * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; - * - */ - com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder - getClassificationModelOptionsOrBuilder(); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java deleted file mode 100644 index 8b3d3f11..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponse.java +++ /dev/null @@ -1,937 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * The document classification response message.
- * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassifyTextResponse} - */ -public final class ClassifyTextResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassifyTextResponse) - ClassifyTextResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassifyTextResponse.newBuilder() to construct. - private ClassifyTextResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ClassifyTextResponse() { - categories_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClassifyTextResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassifyTextResponse.class, - com.google.cloud.language.v1.ClassifyTextResponse.Builder.class); - } - - public static final int CATEGORIES_FIELD_NUMBER = 1; - private java.util.List categories_; - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - @java.lang.Override - public java.util.List getCategoriesList() { - return categories_; - } - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - @java.lang.Override - public java.util.List - getCategoriesOrBuilderList() { - return categories_; - } - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - @java.lang.Override - public int getCategoriesCount() { - return categories_.size(); - } - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategory getCategories(int index) { - return categories_.get(index); - } - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - @java.lang.Override - public com.google.cloud.language.v1.ClassificationCategoryOrBuilder getCategoriesOrBuilder( - int index) { - return categories_.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 < categories_.size(); i++) { - output.writeMessage(1, categories_.get(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < categories_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, categories_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.language.v1.ClassifyTextResponse)) { - return super.equals(obj); - } - com.google.cloud.language.v1.ClassifyTextResponse other = - (com.google.cloud.language.v1.ClassifyTextResponse) obj; - - if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getCategoriesCount() > 0) { - hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; - hash = (53 * hash) + getCategoriesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.language.v1.ClassifyTextResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse 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.language.v1.ClassifyTextResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse 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.language.v1.ClassifyTextResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse 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.language.v1.ClassifyTextResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse 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.language.v1.ClassifyTextResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse 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.language.v1.ClassifyTextResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * The document classification response message.
-   * 
- * - * Protobuf type {@code google.cloud.language.v1.ClassifyTextResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassifyTextResponse) - com.google.cloud.language.v1.ClassifyTextResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.ClassifyTextResponse.class, - com.google.cloud.language.v1.ClassifyTextResponse.Builder.class); - } - - // Construct using com.google.cloud.language.v1.ClassifyTextResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (categoriesBuilder_ == null) { - categories_ = java.util.Collections.emptyList(); - } else { - categories_ = null; - categoriesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextResponse getDefaultInstanceForType() { - return com.google.cloud.language.v1.ClassifyTextResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextResponse build() { - com.google.cloud.language.v1.ClassifyTextResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextResponse buildPartial() { - com.google.cloud.language.v1.ClassifyTextResponse result = - new com.google.cloud.language.v1.ClassifyTextResponse(this); - int from_bitField0_ = bitField0_; - if (categoriesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.categories_ = categories_; - } else { - result.categories_ = categoriesBuilder_.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.language.v1.ClassifyTextResponse) { - return mergeFrom((com.google.cloud.language.v1.ClassifyTextResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.language.v1.ClassifyTextResponse other) { - if (other == com.google.cloud.language.v1.ClassifyTextResponse.getDefaultInstance()) - return this; - if (categoriesBuilder_ == null) { - if (!other.categories_.isEmpty()) { - if (categories_.isEmpty()) { - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCategoriesIsMutable(); - categories_.addAll(other.categories_); - } - onChanged(); - } - } else { - if (!other.categories_.isEmpty()) { - if (categoriesBuilder_.isEmpty()) { - categoriesBuilder_.dispose(); - categoriesBuilder_ = null; - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000001); - categoriesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getCategoriesFieldBuilder() - : null; - } else { - categoriesBuilder_.addAllMessages(other.categories_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.language.v1.ClassificationCategory m = - input.readMessage( - com.google.cloud.language.v1.ClassificationCategory.parser(), - extensionRegistry); - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(m); - } else { - categoriesBuilder_.addMessage(m); - } - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List categories_ = - java.util.Collections.emptyList(); - - private void ensureCategoriesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - categories_ = - new java.util.ArrayList( - categories_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.ClassificationCategory, - com.google.cloud.language.v1.ClassificationCategory.Builder, - com.google.cloud.language.v1.ClassificationCategoryOrBuilder> - categoriesBuilder_; - - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public java.util.List getCategoriesList() { - if (categoriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(categories_); - } else { - return categoriesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public int getCategoriesCount() { - if (categoriesBuilder_ == null) { - return categories_.size(); - } else { - return categoriesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public com.google.cloud.language.v1.ClassificationCategory getCategories(int index) { - if (categoriesBuilder_ == null) { - return categories_.get(index); - } else { - return categoriesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder setCategories( - int index, com.google.cloud.language.v1.ClassificationCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.set(index, value); - onChanged(); - } else { - categoriesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder setCategories( - int index, com.google.cloud.language.v1.ClassificationCategory.Builder builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.set(index, builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder addCategories(com.google.cloud.language.v1.ClassificationCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.add(value); - onChanged(); - } else { - categoriesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder addCategories( - int index, com.google.cloud.language.v1.ClassificationCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.add(index, value); - onChanged(); - } else { - categoriesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder addCategories( - com.google.cloud.language.v1.ClassificationCategory.Builder builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder addCategories( - int index, com.google.cloud.language.v1.ClassificationCategory.Builder builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(index, builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder addAllCategories( - java.lang.Iterable values) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); - onChanged(); - } else { - categoriesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder clearCategories() { - if (categoriesBuilder_ == null) { - categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - categoriesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public Builder removeCategories(int index) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.remove(index); - onChanged(); - } else { - categoriesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public com.google.cloud.language.v1.ClassificationCategory.Builder getCategoriesBuilder( - int index) { - return getCategoriesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public com.google.cloud.language.v1.ClassificationCategoryOrBuilder getCategoriesOrBuilder( - int index) { - if (categoriesBuilder_ == null) { - return categories_.get(index); - } else { - return categoriesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public java.util.List - getCategoriesOrBuilderList() { - if (categoriesBuilder_ != null) { - return categoriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(categories_); - } - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public com.google.cloud.language.v1.ClassificationCategory.Builder addCategoriesBuilder() { - return getCategoriesFieldBuilder() - .addBuilder(com.google.cloud.language.v1.ClassificationCategory.getDefaultInstance()); - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public com.google.cloud.language.v1.ClassificationCategory.Builder addCategoriesBuilder( - int index) { - return getCategoriesFieldBuilder() - .addBuilder( - index, com.google.cloud.language.v1.ClassificationCategory.getDefaultInstance()); - } - /** - * - * - *
-     * Categories representing the input document.
-     * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - public java.util.List - getCategoriesBuilderList() { - return getCategoriesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.ClassificationCategory, - com.google.cloud.language.v1.ClassificationCategory.Builder, - com.google.cloud.language.v1.ClassificationCategoryOrBuilder> - getCategoriesFieldBuilder() { - if (categoriesBuilder_ == null) { - categoriesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.language.v1.ClassificationCategory, - com.google.cloud.language.v1.ClassificationCategory.Builder, - com.google.cloud.language.v1.ClassificationCategoryOrBuilder>( - categories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - categories_ = null; - } - return categoriesBuilder_; - } - - @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.language.v1.ClassifyTextResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassifyTextResponse) - private static final com.google.cloud.language.v1.ClassifyTextResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassifyTextResponse(); - } - - public static com.google.cloud.language.v1.ClassifyTextResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassifyTextResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.language.v1.ClassifyTextResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponseOrBuilder.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponseOrBuilder.java deleted file mode 100644 index f384274a..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextResponseOrBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -public interface ClassifyTextResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassifyTextResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - java.util.List getCategoriesList(); - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - com.google.cloud.language.v1.ClassificationCategory getCategories(int index); - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - int getCategoriesCount(); - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - java.util.List - getCategoriesOrBuilderList(); - /** - * - * - *
-   * Categories representing the input document.
-   * 
- * - * repeated .google.cloud.language.v1.ClassificationCategory categories = 1; - */ - com.google.cloud.language.v1.ClassificationCategoryOrBuilder getCategoriesOrBuilder(int index); -} diff --git a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java b/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java deleted file mode 100644 index d95c65d7..00000000 --- a/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/DependencyEdge.java +++ /dev/null @@ -1,2615 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/language/v1/language_service.proto - -package com.google.cloud.language.v1; - -/** - * - * - *
- * Represents dependency parse tree information for a token. (For more
- * information on dependency labels, see
- * http://www.aclweb.org/anthology/P13-2017
- * 
- * - * Protobuf type {@code google.cloud.language.v1.DependencyEdge} - */ -public final class DependencyEdge extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.language.v1.DependencyEdge) - DependencyEdgeOrBuilder { - private static final long serialVersionUID = 0L; - // Use DependencyEdge.newBuilder() to construct. - private DependencyEdge(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DependencyEdge() { - label_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DependencyEdge(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_DependencyEdge_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.language.v1.LanguageServiceProto - .internal_static_google_cloud_language_v1_DependencyEdge_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.language.v1.DependencyEdge.class, - com.google.cloud.language.v1.DependencyEdge.Builder.class); - } - - /** - * - * - *
-   * The parse label enum for the token.
-   * 
- * - * Protobuf enum {@code google.cloud.language.v1.DependencyEdge.Label} - */ - public enum Label implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Unknown
-     * 
- * - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - * - * - *
-     * Abbreviation modifier
-     * 
- * - * ABBREV = 1; - */ - ABBREV(1), - /** - * - * - *
-     * Adjectival complement
-     * 
- * - * ACOMP = 2; - */ - ACOMP(2), - /** - * - * - *
-     * Adverbial clause modifier
-     * 
- * - * ADVCL = 3; - */ - ADVCL(3), - /** - * - * - *
-     * Adverbial modifier
-     * 
- * - * ADVMOD = 4; - */ - ADVMOD(4), - /** - * - * - *
-     * Adjectival modifier of an NP
-     * 
- * - * AMOD = 5; - */ - AMOD(5), - /** - * - * - *
-     * Appositional modifier of an NP
-     * 
- * - * APPOS = 6; - */ - APPOS(6), - /** - * - * - *
-     * Attribute dependent of a copular verb
-     * 
- * - * ATTR = 7; - */ - ATTR(7), - /** - * - * - *
-     * Auxiliary (non-main) verb
-     * 
- * - * AUX = 8; - */ - AUX(8), - /** - * - * - *
-     * Passive auxiliary
-     * 
- * - * AUXPASS = 9; - */ - AUXPASS(9), - /** - * - * - *
-     * Coordinating conjunction
-     * 
- * - * CC = 10; - */ - CC(10), - /** - * - * - *
-     * Clausal complement of a verb or adjective
-     * 
- * - * CCOMP = 11; - */ - CCOMP(11), - /** - * - * - *
-     * Conjunct
-     * 
- * - * CONJ = 12; - */ - CONJ(12), - /** - * - * - *
-     * Clausal subject
-     * 
- * - * CSUBJ = 13; - */ - CSUBJ(13), - /** - * - * - *
-     * Clausal passive subject
-     * 
- * - * CSUBJPASS = 14; - */ - CSUBJPASS(14), - /** - * - * - *
-     * Dependency (unable to determine)
-     * 
- * - * DEP = 15; - */ - DEP(15), - /** - * - * - *
-     * Determiner
-     * 
- * - * DET = 16; - */ - DET(16), - /** - * - * - *
-     * Discourse
-     * 
- * - * DISCOURSE = 17; - */ - DISCOURSE(17), - /** - * - * - *
-     * Direct object
-     * 
- * - * DOBJ = 18; - */ - DOBJ(18), - /** - * - * - *
-     * Expletive
-     * 
- * - * EXPL = 19; - */ - EXPL(19), - /** - * - * - *
-     * Goes with (part of a word in a text not well edited)
-     * 
- * - * GOESWITH = 20; - */ - GOESWITH(20), - /** - * - * - *
-     * Indirect object
-     * 
- * - * IOBJ = 21; - */ - IOBJ(21), - /** - * - * - *
-     * Marker (word introducing a subordinate clause)
-     * 
- * - * MARK = 22; - */ - MARK(22), - /** - * - * - *
-     * Multi-word expression
-     * 
- * - * MWE = 23; - */ - MWE(23), - /** - * - * - *
-     * Multi-word verbal expression
-     * 
- * - * MWV = 24; - */ - MWV(24), - /** - * - * - *
-     * Negation modifier
-     * 
- * - * NEG = 25; - */ - NEG(25), - /** - * - * - *
-     * Noun compound modifier
-     * 
- * - * NN = 26; - */ - NN(26), - /** - * - * - *
-     * Noun phrase used as an adverbial modifier
-     * 
- * - * NPADVMOD = 27; - */ - NPADVMOD(27), - /** - * - * - *
-     * Nominal subject
-     * 
- * - * NSUBJ = 28; - */ - NSUBJ(28), - /** - * - * - *
-     * Passive nominal subject
-     * 
- * - * NSUBJPASS = 29; - */ - NSUBJPASS(29), - /** - * - * - *
-     * Numeric modifier of a noun
-     * 
- * - * NUM = 30; - */ - NUM(30), - /** - * - * - *
-     * Element of compound number
-     * 
- * - * NUMBER = 31; - */ - NUMBER(31), - /** - * - * - *
-     * Punctuation mark
-     * 
- * - * P = 32; - */ - P(32), - /** - * - * - *
-     * Parataxis relation
-     * 
- * - * PARATAXIS = 33; - */ - PARATAXIS(33), - /** - * - * - *
-     * Participial modifier
-     * 
- * - * PARTMOD = 34; - */ - PARTMOD(34), - /** - * - * - *
-     * The complement of a preposition is a clause
-     * 
- * - * PCOMP = 35; - */ - PCOMP(35), - /** - * - * - *
-     * Object of a preposition
-     * 
- * - * POBJ = 36; - */ - POBJ(36), - /** - * - * - *
-     * Possession modifier
-     * 
- * - * POSS = 37; - */ - POSS(37), - /** - * - * - *
-     * Postverbal negative particle
-     * 
- * - * POSTNEG = 38; - */ - POSTNEG(38), - /** - * - * - *
-     * Predicate complement
-     * 
- * - * PRECOMP = 39; - */ - PRECOMP(39), - /** - * - * - *
-     * Preconjunt
-     * 
- * - * PRECONJ = 40; - */ - PRECONJ(40), - /** - * - * - *
-     * Predeterminer
-     * 
- * - * PREDET = 41; - */ - PREDET(41), - /** - * - * - *
-     * Prefix
-     * 
- * - * PREF = 42; - */ - PREF(42), - /** - * - * - *
-     * Prepositional modifier
-     * 
- * - * PREP = 43; - */ - PREP(43), - /** - * - * - *
-     * The relationship between a verb and verbal morpheme
-     * 
- * - * PRONL = 44; - */ - PRONL(44), - /** - * - * - *
-     * Particle
-     * 
- * - * PRT = 45; - */ - PRT(45), - /** - * - * - *
-     * Associative or possessive marker
-     * 
- * - * PS = 46; - */ - PS(46), - /** - * - * - *
-     * Quantifier phrase modifier
-     * 
- * - * QUANTMOD = 47; - */ - QUANTMOD(47), - /** - * - * - *
-     * Relative clause modifier
-     * 
- * - * RCMOD = 48; - */ - RCMOD(48), - /** - * - * - *
-     * Complementizer in relative clause
-     * 
- * - * RCMODREL = 49; - */ - RCMODREL(49), - /** - * - * - *
-     * Ellipsis without a preceding predicate
-     * 
- * - * RDROP = 50; - */ - RDROP(50), - /** - * - * - *
-     * Referent
-     * 
- * - * REF = 51; - */ - REF(51), - /** - * - * - *
-     * Remnant
-     * 
- * - * REMNANT = 52; - */ - REMNANT(52), - /** - * - * - *
-     * Reparandum
-     * 
- * - * REPARANDUM = 53; - */ - REPARANDUM(53), - /** - * - * - *
-     * Root
-     * 
- * - * ROOT = 54; - */ - ROOT(54), - /** - * - * - *
-     * Suffix specifying a unit of number
-     * 
- * - * SNUM = 55; - */ - SNUM(55), - /** - * - * - *
-     * Suffix
-     * 
- * - * SUFF = 56; - */ - SUFF(56), - /** - * - * - *
-     * Temporal modifier
-     * 
- * - * TMOD = 57; - */ - TMOD(57), - /** - * - * - *
-     * Topic marker
-     * 
- * - * TOPIC = 58; - */ - TOPIC(58), - /** - * - * - *
-     * Clause headed by an infinite form of the verb that modifies a noun
-     * 
- * - * VMOD = 59; - */ - VMOD(59), - /** - * - * - *
-     * Vocative
-     * 
- * - * VOCATIVE = 60; - */ - VOCATIVE(60), - /** - * - * - *
-     * Open clausal complement
-     * 
- * - * XCOMP = 61; - */ - XCOMP(61), - /** - * - * - *
-     * Name suffix
-     * 
- * - * SUFFIX = 62; - */ - SUFFIX(62), - /** - * - * - *
-     * Name title
-     * 
- * - * TITLE = 63; - */ - TITLE(63), - /** - * - * - *
-     * Adverbial phrase modifier
-     * 
- * - * ADVPHMOD = 64; - */ - ADVPHMOD(64), - /** - * - * - *
-     * Causative auxiliary
-     * 
- * - * AUXCAUS = 65; - */ - AUXCAUS(65), - /** - * - * - *
-     * Helper auxiliary
-     * 
- * - * AUXVV = 66; - */ - AUXVV(66), - /** - * - * - *
-     * Rentaishi (Prenominal modifier)
-     * 
- * - * DTMOD = 67; - */ - DTMOD(67), - /** - * - * - *
-     * Foreign words
-     * 
- * - * FOREIGN = 68; - */ - FOREIGN(68), - /** - * - * - *
-     * Keyword
-     * 
- * - * KW = 69; - */ - KW(69), - /** - * - * - *
-     * List for chains of comparable items
-     * 
- * - * LIST = 70; - */ - LIST(70), - /** - * - * - *
-     * Nominalized clause
-     * 
- * - * NOMC = 71; - */ - NOMC(71), - /** - * - * - *
-     * Nominalized clausal subject
-     * 
- * - * NOMCSUBJ = 72; - */ - NOMCSUBJ(72), - /** - * - * - *
-     * Nominalized clausal passive
-     * 
- * - * NOMCSUBJPASS = 73; - */ - NOMCSUBJPASS(73), - /** - * - * - *
-     * Compound of numeric modifier
-     * 
- * - * NUMC = 74; - */ - NUMC(74), - /** - * - * - *
-     * Copula
-     * 
- * - * COP = 75; - */ - COP(75), - /** - * - * - *
-     * Dislocated relation (for fronted/topicalized elements)
-     * 
- * - * DISLOCATED = 76; - */ - DISLOCATED(76), - /** - * - * - *
-     * Aspect marker
-     * 
- * - * ASP = 77; - */ - ASP(77), - /** - * - * - *
-     * Genitive modifier
-     * 
- * - * GMOD = 78; - */ - GMOD(78), - /** - * - * - *
-     * Genitive object
-     * 
- * - * GOBJ = 79; - */ - GOBJ(79), - /** - * - * - *
-     * Infinitival modifier
-     * 
- * - * INFMOD = 80; - */ - INFMOD(80), - /** - * - * - *
-     * Measure
-     * 
- * - * MES = 81; - */ - MES(81), - /** - * - * - *
-     * Nominal complement of a noun
-     * 
- * - * NCOMP = 82; - */ - NCOMP(82), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Unknown
-     * 
- * - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - * - * - *
-     * Abbreviation modifier
-     * 
- * - * ABBREV = 1; - */ - public static final int ABBREV_VALUE = 1; - /** - * - * - *
-     * Adjectival complement
-     * 
- * - * ACOMP = 2; - */ - public static final int ACOMP_VALUE = 2; - /** - * - * - *
-     * Adverbial clause modifier
-     * 
- * - * ADVCL = 3; - */ - public static final int ADVCL_VALUE = 3; - /** - * - * - *
-     * Adverbial modifier
-     * 
- * - * ADVMOD = 4; - */ - public static final int ADVMOD_VALUE = 4; - /** - * - * - *
-     * Adjectival modifier of an NP
-     * 
- * - * AMOD = 5; - */ - public static final int AMOD_VALUE = 5; - /** - * - * - *
-     * Appositional modifier of an NP
-     * 
- * - * APPOS = 6; - */ - public static final int APPOS_VALUE = 6; - /** - * - * - *
-     * Attribute dependent of a copular verb
-     * 
- * - * ATTR = 7; - */ - public static final int ATTR_VALUE = 7; - /** - * - * - *
-     * Auxiliary (non-main) verb
-     * 
- * - * AUX = 8; - */ - public static final int AUX_VALUE = 8; - /** - * - * - *
-     * Passive auxiliary
-     * 
- * - * AUXPASS = 9; - */ - public static final int AUXPASS_VALUE = 9; - /** - * - * - *
-     * Coordinating conjunction
-     * 
- * - * CC = 10; - */ - public static final int CC_VALUE = 10; - /** - * - * - *
-     * Clausal complement of a verb or adjective
-     * 
- * - * CCOMP = 11; - */ - public static final int CCOMP_VALUE = 11; - /** - * - * - *
-     * Conjunct
-     * 
- * - * CONJ = 12; - */ - public static final int CONJ_VALUE = 12; - /** - * - * - *
-     * Clausal subject
-     * 
- * - * CSUBJ = 13; - */ - public static final int CSUBJ_VALUE = 13; - /** - * - * - *
-     * Clausal passive subject
-     * 
- * - * CSUBJPASS = 14; - */ - public static final int CSUBJPASS_VALUE = 14; - /** - * - * - *
-     * Dependency (unable to determine)
-     * 
- * - * DEP = 15; - */ - public static final int DEP_VALUE = 15; - /** - * - * - *
-     * Determiner
-     * 
- * - * DET = 16; - */ - public static final int DET_VALUE = 16; - /** - * - * - *
-     * Discourse
-     * 
- * - * DISCOURSE = 17; - */ - public static final int DISCOURSE_VALUE = 17; - /** - * - * - *
-     * Direct object
-     * 
- * - * DOBJ = 18; - */ - public static final int DOBJ_VALUE = 18; - /** - * - * - *
-     * Expletive
-     * 
- * - * EXPL = 19; - */ - public static final int EXPL_VALUE = 19; - /** - * - * - *
-     * Goes with (part of a word in a text not well edited)
-     * 
- * - * GOESWITH = 20; - */ - public static final int GOESWITH_VALUE = 20; - /** - * - * - *
-     * Indirect object
-     * 
- * - * IOBJ = 21; - */ - public static final int IOBJ_VALUE = 21; - /** - * - * - *
-     * Marker (word introducing a subordinate clause)
-     * 
- * - * MARK = 22; - */ - public static final int MARK_VALUE = 22; - /** - * - * - *
-     * Multi-word expression
-     * 
- * - * MWE = 23; - */ - public static final int MWE_VALUE = 23; - /** - * - * - *
-     * Multi-word verbal expression
-     * 
- * - * MWV = 24; - */ - public static final int MWV_VALUE = 24; - /** - * - * - *
-     * Negation modifier
-     * 
- * - * NEG = 25; - */ - public static final int NEG_VALUE = 25; - /** - * - * - *
-     * Noun compound modifier
-     * 
- * - * NN = 26; - */ - public static final int NN_VALUE = 26; - /** - * - * - *
-     * Noun phrase used as an adverbial modifier
-     * 
- * - * NPADVMOD = 27; - */ - public static final int NPADVMOD_VALUE = 27; - /** - * - * - *
-     * Nominal subject
-     * 
- * - * NSUBJ = 28; - */ - public static final int NSUBJ_VALUE = 28; - /** - * - * - *
-     * Passive nominal subject
-     * 
- * - * NSUBJPASS = 29; - */ - public static final int NSUBJPASS_VALUE = 29; - /** - * - * - *
-     * Numeric modifier of a noun
-     * 
- * - * NUM = 30; - */ - public static final int NUM_VALUE = 30; - /** - * - * - *
-     * Element of compound number
-     * 
- * - * NUMBER = 31; - */ - public static final int NUMBER_VALUE = 31; - /** - * - * - *
-     * Punctuation mark
-     * 
- * - * P = 32; - */ - public static final int P_VALUE = 32; - /** - * - * - *
-     * Parataxis relation
-     * 
- * - * PARATAXIS = 33; - */ - public static final int PARATAXIS_VALUE = 33; - /** - * - * - *
-     * Participial modifier
-     * 
- * - * PARTMOD = 34; - */ - public static final int PARTMOD_VALUE = 34; - /** - * - * - *
-     * The complement of a preposition is a clause
-     * 
- * - * PCOMP = 35; - */ - public static final int PCOMP_VALUE = 35; - /** - * - * - *
-     * Object of a preposition
-     * 
- * - * POBJ = 36; - */ - public static final int POBJ_VALUE = 36; - /** - * - * - *
-     * Possession modifier
-     * 
- * - * POSS = 37; - */ - public static final int POSS_VALUE = 37; - /** - * - * - *
-     * Postverbal negative particle
-     * 
- * - * POSTNEG = 38; - */ - public static final int POSTNEG_VALUE = 38; - /** - * - * - *
-     * Predicate complement
-     * 
- * - * PRECOMP = 39; - */ - public static final int PRECOMP_VALUE = 39; - /** - * - * - *
-     * Preconjunt
-     * 
- * - * PRECONJ = 40; - */ - public static final int PRECONJ_VALUE = 40; - /** - * - * - *
-     * Predeterminer
-     * 
- * - * PREDET = 41; - */ - public static final int PREDET_VALUE = 41; - /** - * - * - *
-     * Prefix
-     * 
- * - * PREF = 42; - */ - public static final int PREF_VALUE = 42; - /** - * - * - *
-     * Prepositional modifier
-     * 
- * - * PREP = 43; - */ - public static final int PREP_VALUE = 43; - /** - * - * - *
-     * The relationship between a verb and verbal morpheme
-     * 
- * - * PRONL = 44; - */ - public static final int PRONL_VALUE = 44; - /** - * - * - *
-     * Particle
-     * 
- * - * PRT = 45; - */ - public static final int PRT_VALUE = 45; - /** - * - * - *
-     * Associative or possessive marker
-     * 
- * - * PS = 46; - */ - public static final int PS_VALUE = 46; - /** - * - * - *
-     * Quantifier phrase modifier
-     * 
- * - * QUANTMOD = 47; - */ - public static final int QUANTMOD_VALUE = 47; - /** - * - * - *
-     * Relative clause modifier
-     * 
- * - * RCMOD = 48; - */ - public static final int RCMOD_VALUE = 48; - /** - * - * - *
-     * Complementizer in relative clause
-     * 
- * - * RCMODREL = 49; - */ - public static final int RCMODREL_VALUE = 49; - /** - * - * - *
-     * Ellipsis without a preceding predicate
-     * 
- * - * RDROP = 50; - */ - public static final int RDROP_VALUE = 50; - /** - * - * - *
-     * Referent
-     * 
- * - * REF = 51; - */ - public static final int REF_VALUE = 51; - /** - * - * - *
-     * Remnant
-     * 
- * - * REMNANT = 52; - */ - public static final int REMNANT_VALUE = 52; - /** - * - * - *
-     * Reparandum
-     * 
- * - * REPARANDUM = 53; - */ - public static final int REPARANDUM_VALUE = 53; - /** - * - * - *
-     * Root
-     * 
- * - * ROOT = 54; - */ - public static final int ROOT_VALUE = 54; - /** - * - * - *
-     * Suffix specifying a unit of number
-     * 
- * - * SNUM = 55; - */ - public static final int SNUM_VALUE = 55; - /** - * - * - *
-     * Suffix
-     * 
- * - * SUFF = 56; - */ - public static final int SUFF_VALUE = 56; - /** - * - * - *
-     * Temporal modifier
-     * 
- * - * TMOD = 57; - */ - public static final int TMOD_VALUE = 57; - /** - * - * - *
-     * Topic marker
-     * 
- * - * TOPIC = 58; - */ - public static final int TOPIC_VALUE = 58; - /** - * - * - *
-     * Clause headed by an infinite form of the verb that modifies a noun
-     * 
- * - * VMOD = 59; - */ - public static final int VMOD_VALUE = 59; - /** - * - * - *
-     * Vocative
-     * 
- * - * VOCATIVE = 60; - */ - public static final int VOCATIVE_VALUE = 60; - /** - * - * - *
-     * Open clausal complement
-     * 
- * - * XCOMP = 61; - */ - public static final int XCOMP_VALUE = 61; - /** - * - * - *
-     * Name suffix
-     * 
- * - * SUFFIX = 62; - */ - public static final int SUFFIX_VALUE = 62; - /** - * - * - *
-     * Name title
-     * 
- * - * TITLE = 63; - */ - public static final int TITLE_VALUE = 63; - /** - * - * - *
-     * Adverbial phrase modifier
-     * 
- * - * ADVPHMOD = 64; - */ - public static final int ADVPHMOD_VALUE = 64; - /** - * - * - *
-     * Causative auxiliary
-     * 
- * - * AUXCAUS = 65; - */ - public static final int AUXCAUS_VALUE = 65; - /** - * - * - *
-     * Helper auxiliary
-     * 
- * - * AUXVV = 66; - */ - public static final int AUXVV_VALUE = 66; - /** - * - * - *
-     * Rentaishi (Prenominal modifier)
-     * 
- * - * DTMOD = 67; - */ - public static final int DTMOD_VALUE = 67; - /** - * - * - *
-     * Foreign words
-     * 
- * - * FOREIGN = 68; - */ - public static final int FOREIGN_VALUE = 68; - /** - * - * - *
-     * Keyword
-     * 
- * - * KW = 69; - */ - public static final int KW_VALUE = 69; - /** - * - * - *
-     * List for chains of comparable items
-     * 
- * - * LIST = 70; - */ - public static final int LIST_VALUE = 70; - /** - * - * - *
-     * Nominalized clause
-     * 
- * - * NOMC = 71; - */ - public static final int NOMC_VALUE = 71; - /** - * - * - *
-     * Nominalized clausal subject
-     * 
- * - * NOMCSUBJ = 72; - */ - public static final int NOMCSUBJ_VALUE = 72; - /** - * - * - *
-     * Nominalized clausal passive
-     * 
- * - * NOMCSUBJPASS = 73; - */ - public static final int NOMCSUBJPASS_VALUE = 73; - /** - * - * - *
-     * Compound of numeric modifier
-     * 
- * - * NUMC = 74; - */ - public static final int NUMC_VALUE = 74; - /** - * - * - *
-     * Copula
-     * 
- * - * COP = 75; - */ - public static final int COP_VALUE = 75; - /** - * - * - *
-     * Dislocated relation (for fronted/topicalized elements)
-     * 
- * - * DISLOCATED = 76; - */ - public static final int DISLOCATED_VALUE = 76; - /** - * - * - *
-     * Aspect marker
-     * 
- * - * ASP = 77; - */ - public static final int ASP_VALUE = 77; - /** - * - * - *
-     * Genitive modifier
-     * 
- * - * GMOD = 78; - */ - public static final int GMOD_VALUE = 78; - /** - * - * - *
-     * Genitive object
-     * 
- * - * GOBJ = 79; - */ - public static final int GOBJ_VALUE = 79; - /** - * - * - *
-     * Infinitival modifier
-     * 
- * - * INFMOD = 80; - */ - public static final int INFMOD_VALUE = 80; - /** - * - * - *
-     * Measure
-     * 
- * - * MES = 81; - */ - public static final int MES_VALUE = 81; - /** - * - * - *
-     * Nominal complement of a noun
-     * 
- * - * NCOMP = 82; - */ - public static final int NCOMP_VALUE = 82; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Label 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 Label forNumber(int value) { - switch (value) { - case 0: - return UNKNOWN; - case 1: - return ABBREV; - case 2: - return ACOMP; - case 3: - return ADVCL; - case 4: - return ADVMOD; - case 5: - return AMOD; - case 6: - return APPOS; - case 7: - return ATTR; - case 8: - return AUX; - case 9: - return AUXPASS; - case 10: - return CC; - case 11: - return CCOMP; - case 12: - return CONJ; - case 13: - return CSUBJ; - case 14: - return CSUBJPASS; - case 15: - return DEP; - case 16: - return DET; - case 17: - return DISCOURSE; - case 18: - return DOBJ; - case 19: - return EXPL; - case 20: - return GOESWITH; - case 21: - return IOBJ; - case 22: - return MARK; - case 23: - return MWE; - case 24: - return MWV; - case 25: - return NEG; - case 26: - return NN; - case 27: - return NPADVMOD; - case 28: - return NSUBJ; - case 29: - return NSUBJPASS; - case 30: - return NUM; - case 31: - return NUMBER; - case 32: - return P; - case 33: - return PARATAXIS; - case 34: - return PARTMOD; - case 35: - return PCOMP; - case 36: - return POBJ; - case 37: - return POSS; - case 38: - return POSTNEG; - case 39: - return PRECOMP; - case 40: - return PRECONJ; - case 41: - return PREDET; - case 42: - return PREF; - case 43: - return PREP; - case 44: - return PRONL; - case 45: - return PRT; - case 46: - return PS; - case 47: - return QUANTMOD; - case 48: - return RCMOD; - case 49: - return RCMODREL; - case 50: - return RDROP; - case 51: - return REF; - case 52: - return REMNANT; - case 53: - return REPARANDUM; - case 54: - return ROOT; - case 55: - return SNUM; - case 56: - return SUFF; - case 57: - return TMOD; - case 58: - return TOPIC; - case 59: - return VMOD; - case 60: - return VOCATIVE; - case 61: - return XCOMP; - case 62: - return SUFFIX; - case 63: - return TITLE; - case 64: - return ADVPHMOD; - case 65: - return AUXCAUS; - case 66: - return AUXVV; - case 67: - return DTMOD; - case 68: - return FOREIGN; - case 69: - return KW; - case 70: - return LIST; - case 71: - return NOMC; - case 72: - return NOMCSUBJ; - case 73: - return NOMCSUBJPASS; - case 74: - return NUMC; - case 75: - return COP; - case 76: - return DISLOCATED; - case 77: - return ASP; - case 78: - return GMOD; - case 79: - return GOBJ; - case 80: - return INFMOD; - case 81: - return MES; - case 82: - return NCOMP; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap