diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..515b8e8a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-recommendations-ai/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. recommendationengine 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 new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +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 new file mode 100644 index 00000000..f9431e6d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +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-recommendations-ai/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..dce2c845 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..bbec058d --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ \ No newline at end of file diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..73405a12 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" github/java-recommendations-ai/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..827a459e --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,108 @@ +#!/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}/.. + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + if [[ -f samples/pom.xml ]] + then + pushd samples + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-recommendations-ai +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..f4b9b352 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# 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-recommendations-ai/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/build.sh" +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..b7bb37fc --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# 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-recommendations-ai/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/dependencies.cfg b/.kokoro/continuous/dependencies.cfg new file mode 100644 index 00000000..cce9a097 --- /dev/null +++ b/.kokoro/continuous/dependencies.cfg @@ -0,0 +1,12 @@ +# 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-recommendations-ai/.kokoro/dependencies.sh" +} diff --git a/.kokoro/continuous/integration.cfg b/.kokoro/continuous/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/integration.cfg @@ -0,0 +1,7 @@ +# 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" +} diff --git a/.kokoro/continuous/java11.cfg b/.kokoro/continuous/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/continuous/java11.cfg @@ -0,0 +1,7 @@ +# 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/continuous/java7.cfg b/.kokoro/continuous/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/continuous/java7.cfg @@ -0,0 +1,7 @@ +# 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/continuous/java8-osx.cfg b/.kokoro/continuous/java8-osx.cfg new file mode 100644 index 00000000..b290f85a --- /dev/null +++ b/.kokoro/continuous/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-recommendations-ai/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 00000000..e0f19995 --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-recommendations-ai/.kokoro/build.bat" diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# 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/lint.cfg b/.kokoro/continuous/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/continuous/lint.cfg @@ -0,0 +1,13 @@ +# 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/continuous/propose_release.cfg b/.kokoro/continuous/propose_release.cfg new file mode 100644 index 00000000..ccfc1ffb --- /dev/null +++ b/.kokoro/continuous/propose_release.cfg @@ -0,0 +1,53 @@ +# 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-recommendations-ai/.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-recommendations-ai/.kokoro/continuous/propose_release.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/continuous/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/continuous/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..f8ad2928 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,31 @@ +#!/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 + +cd github/java-recommendations-ai/ + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 00000000..9a8acbbc --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +# Display commands being run. +set -x + +cd github/java-recommendations-ai/ + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..b7bb37fc --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# 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-recommendations-ai/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/dependencies.cfg b/.kokoro/nightly/dependencies.cfg new file mode 100644 index 00000000..cce9a097 --- /dev/null +++ b/.kokoro/nightly/dependencies.cfg @@ -0,0 +1,12 @@ +# 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-recommendations-ai/.kokoro/dependencies.sh" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..8bf59c02 --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,21 @@ +# 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: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 00000000..b290f85a --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-recommendations-ai/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..e0f19995 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-recommendations-ai/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# 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/lint.cfg b/.kokoro/nightly/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/nightly/lint.cfg @@ -0,0 +1,13 @@ +# 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/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..b4b051cd --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,36 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# 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 new file mode 100644 index 00000000..052e899f --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# 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-recommendations-ai/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.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 new file mode 100644 index 00000000..cce9a097 --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# 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-recommendations-ai/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..141f90c1 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 00000000..b290f85a --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-recommendations-ai/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..e0f19995 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-recommendations-ai/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# 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 new file mode 100644 index 00000000..9943ba38 --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# 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-recommendations-ai/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# 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 new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..044c0018 --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# 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-recommendations-ai/.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-recommendations-ai/.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/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..91df5e8a --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# 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-recommendations-ai/.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 new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..f777424c --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..e8f6a08c --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..d2708441 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.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 new file mode 100755 index 00000000..5bcea0a3 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -DskipTests=true + +NAME=google-cloud-recommendations-ai +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..0049f934 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..098168a7 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..8384cb12 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,44 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-recommendations-ai/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-recommendations-ai/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-recommendations-ai" + } +} + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..3c482cbc --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..ba17ce01 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..0254d844 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "recommendationengine", + "name_pretty": "Recommendations AI", + "product_documentation": "https://cloud.google.com/recommendations-ai/", + "api_description": "delivers highly personalized product recommendations at scale.", + "client_documentation": "https://googleapis.dev/java/google-cloud-recommendations-ai/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-recommendations-ai", + "repo_short": "java-recommendations-ai", + "distribution_name": "com.google.cloud:google-cloud-recommendations-ai", + "api_id": "recommendationengine.googleapis.com", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..6b2238bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the +Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..085021dd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,130 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/README.md b/README.md new file mode 100644 index 00000000..4c1be454 --- /dev/null +++ b/README.md @@ -0,0 +1,163 @@ +# Google Recommendations AI Client for Java + +Java idiomatic client for [Recommendations AI][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file +```xml + + + + com.google.cloud + libraries-bom + 4.3.0 + pom + import + + + + + + com.google.cloud + google-cloud-recommendations-ai + + +``` + +[//]: # ({x-version-update-start:google-cloud-recommendations-ai:released}) + +If you are using Maven without BOM, add this to your dependencies: + +```xml + + com.google.cloud + google-cloud-recommendations-ai + 0.0.0 + +``` + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-recommendations-ai:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-recommendations-ai" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Recommendations AI [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Recommendations AI. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-recommendations-ai` library. See the [Quickstart](#quickstart) section +to add `google-cloud-recommendations-ai` as a dependency in your code. + +## About Recommendations AI + + +[Recommendations AI][product-docs] delivers highly personalized product recommendations at scale. + +See the [Recommendations AI client library docs][javadocs] to learn how to +use this Recommendations AI Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Recommendations AI uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +[product-docs]: https://cloud.google.com/recommendations-ai/ +[javadocs]: https://googleapis.dev/java/google-cloud-recommendations-ai/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-recommendations-ai/java11.html +[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-recommendations-ai.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-recommendations-ai&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-recommendations-ai/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-recommendations-ai/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-recommendations-ai/blob/master/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=recommendationengine.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-recommendations-ai-bom/pom.xml b/google-cloud-recommendations-ai-bom/pom.xml new file mode 100644 index 00000000..770f9216 --- /dev/null +++ b/google-cloud-recommendations-ai-bom/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + com.google.cloud + google-cloud-recommendations-ai-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.4.0 + + + Google Recommendations AI BOM + https://github.com/googleapis/java-recommendations-ai + + BOM for Recommendations AI + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-recommendations-ai.git + scm:git:git@github.com:googleapis/java-recommendations-ai.git + https://github.com/googleapis/java-recommendations-ai + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + + com.google.cloud + google-cloud-recommendations-ai + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-recommendations-ai-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-recommendations-ai-v1beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-recommendations-ai/pom.xml b/google-cloud-recommendations-ai/pom.xml new file mode 100644 index 00000000..df6b1f8c --- /dev/null +++ b/google-cloud-recommendations-ai/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + com.google.cloud + google-cloud-recommendations-ai + 0.0.1-SNAPSHOT + jar + Google Recommendations AI + https://github.com/googleapis/java-recommendations-ai + delivers highly personalized product recommendations at scale. + + com.google.cloud + google-cloud-recommendations-ai-parent + 0.0.1-SNAPSHOT + + + google-cloud-recommendations-ai + + + + 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-recommendations-ai-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-recommendations-ai-v1beta1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java new file mode 100644 index 00000000..8f252ca6 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java @@ -0,0 +1,930 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.recommendationengine.v1beta1.stub.CatalogServiceStub; +import com.google.cloud.recommendationengine.v1beta1.stub.CatalogServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for ingesting catalog information of the customer's website. + * + *

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

+ * 
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+ *   CatalogItem response = catalogServiceClient.createCatalogItem(formattedParent, catalogItem);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * CatalogServiceSettings catalogServiceSettings =
+ *     CatalogServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CatalogServiceClient catalogServiceClient =
+ *     CatalogServiceClient.create(catalogServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * CatalogServiceSettings catalogServiceSettings =
+ *     CatalogServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CatalogServiceClient catalogServiceClient =
+ *     CatalogServiceClient.create(catalogServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CatalogServiceClient implements BackgroundResource { + private final CatalogServiceSettings settings; + private final CatalogServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate CATALOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}"); + + private static final PathTemplate CATALOG_ITEM_PATH_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path=**}"); + + /** + * Formats a string containing the fully-qualified path to represent a catalog resource. + * + * @deprecated Use the {@link CatalogName} class instead. + */ + @Deprecated + public static final String formatCatalogName(String project, String location, String catalog) { + return CATALOG_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "catalog", catalog); + } + + /** + * Formats a string containing the fully-qualified path to represent a catalog_item_path resource. + * + * @deprecated Use the {@link CatalogItemPathName} class instead. + */ + @Deprecated + public static final String formatCatalogItemPathName( + String project, String location, String catalog, String catalogItemPath) { + return CATALOG_ITEM_PATH_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "catalog", catalog, + "catalog_item_path", catalogItemPath); + } + + /** + * Parses the project from the given fully-qualified path which represents a catalog resource. + * + * @deprecated Use the {@link CatalogName} class instead. + */ + @Deprecated + public static final String parseProjectFromCatalogName(String catalogName) { + return CATALOG_PATH_TEMPLATE.parse(catalogName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a catalog resource. + * + * @deprecated Use the {@link CatalogName} class instead. + */ + @Deprecated + public static final String parseLocationFromCatalogName(String catalogName) { + return CATALOG_PATH_TEMPLATE.parse(catalogName).get("location"); + } + + /** + * Parses the catalog from the given fully-qualified path which represents a catalog resource. + * + * @deprecated Use the {@link CatalogName} class instead. + */ + @Deprecated + public static final String parseCatalogFromCatalogName(String catalogName) { + return CATALOG_PATH_TEMPLATE.parse(catalogName).get("catalog"); + } + + /** + * Parses the project from the given fully-qualified path which represents a catalog_item_path + * resource. + * + * @deprecated Use the {@link CatalogItemPathName} class instead. + */ + @Deprecated + public static final String parseProjectFromCatalogItemPathName(String catalogItemPathName) { + return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a catalog_item_path + * resource. + * + * @deprecated Use the {@link CatalogItemPathName} class instead. + */ + @Deprecated + public static final String parseLocationFromCatalogItemPathName(String catalogItemPathName) { + return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("location"); + } + + /** + * Parses the catalog from the given fully-qualified path which represents a catalog_item_path + * resource. + * + * @deprecated Use the {@link CatalogItemPathName} class instead. + */ + @Deprecated + public static final String parseCatalogFromCatalogItemPathName(String catalogItemPathName) { + return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("catalog"); + } + + /** + * Parses the catalog_item_path from the given fully-qualified path which represents a + * catalog_item_path resource. + * + * @deprecated Use the {@link CatalogItemPathName} class instead. + */ + @Deprecated + public static final String parseCatalogItemPathFromCatalogItemPathName( + String catalogItemPathName) { + return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("catalog_item_path"); + } + + /** Constructs an instance of CatalogServiceClient with default settings. */ + public static final CatalogServiceClient create() throws IOException { + return create(CatalogServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient create(CatalogServiceSettings settings) + throws IOException { + return new CatalogServiceClient(settings); + } + + /** + * Constructs an instance of CatalogServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer to use CatalogServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CatalogServiceClient create(CatalogServiceStub stub) { + return new CatalogServiceClient(stub); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient(CatalogServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CatalogServiceClient(CatalogServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CatalogServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CatalogServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+   *   CatalogItem response = catalogServiceClient.createCatalogItem(formattedParent, catalogItem);
+   * }
+   * 
+ * + * @param parent Required. The parent catalog resource name, such as + * "projects/*/locations/global/catalogs/default_catalog". + * @param catalogItem Required. The catalog item to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CatalogItem createCatalogItem(String parent, CatalogItem catalogItem) { + CATALOG_PATH_TEMPLATE.validate(parent, "createCatalogItem"); + CreateCatalogItemRequest request = + CreateCatalogItemRequest.newBuilder().setParent(parent).setCatalogItem(catalogItem).build(); + return createCatalogItem(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+   *   CreateCatalogItemRequest request = CreateCatalogItemRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCatalogItem(catalogItem)
+   *     .build();
+   *   CatalogItem response = catalogServiceClient.createCatalogItem(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 CatalogItem createCatalogItem(CreateCatalogItemRequest request) { + return createCatalogItemCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+   *   CreateCatalogItemRequest request = CreateCatalogItemRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCatalogItem(catalogItem)
+   *     .build();
+   *   ApiFuture<CatalogItem> future = catalogServiceClient.createCatalogItemCallable().futureCall(request);
+   *   // Do something
+   *   CatalogItem response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createCatalogItemCallable() { + return stub.createCatalogItemCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a specific catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   CatalogItem response = catalogServiceClient.getCatalogItem(formattedName);
+   * }
+   * 
+ * + * @param name Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CatalogItem getCatalogItem(String name) { + CATALOG_ITEM_PATH_PATH_TEMPLATE.validate(name, "getCatalogItem"); + GetCatalogItemRequest request = GetCatalogItemRequest.newBuilder().setName(name).build(); + return getCatalogItem(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a specific catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   GetCatalogItemRequest request = GetCatalogItemRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   CatalogItem response = catalogServiceClient.getCatalogItem(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 CatalogItem getCatalogItem(GetCatalogItemRequest request) { + return getCatalogItemCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a specific catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   GetCatalogItemRequest request = GetCatalogItemRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<CatalogItem> future = catalogServiceClient.getCatalogItemCallable().futureCall(request);
+   *   // Do something
+   *   CatalogItem response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getCatalogItemCallable() { + return stub.getCatalogItemCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of catalog items. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   String filter = "";
+   *   for (CatalogItem element : catalogServiceClient.listCatalogItems(formattedParent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent catalog resource name, such as + * "projects/*/locations/global/catalogs/default_catalog". + * @param filter Optional. A filter to apply on the list results. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogItemsPagedResponse listCatalogItems(String parent, String filter) { + CATALOG_PATH_TEMPLATE.validate(parent, "listCatalogItems"); + ListCatalogItemsRequest request = + ListCatalogItemsRequest.newBuilder().setParent(parent).setFilter(filter).build(); + return listCatalogItems(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of catalog items. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   ListCatalogItemsRequest request = ListCatalogItemsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (CatalogItem element : catalogServiceClient.listCatalogItems(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListCatalogItemsPagedResponse listCatalogItems(ListCatalogItemsRequest request) { + return listCatalogItemsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of catalog items. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   ListCatalogItemsRequest request = ListCatalogItemsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListCatalogItemsPagedResponse> future = catalogServiceClient.listCatalogItemsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (CatalogItem element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCatalogItemsPagedCallable() { + return stub.listCatalogItemsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of catalog items. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   ListCatalogItemsRequest request = ListCatalogItemsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListCatalogItemsResponse response = catalogServiceClient.listCatalogItemsCallable().call(request);
+   *     for (CatalogItem element : response.getCatalogItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCatalogItemsCallable() { + return stub.listCatalogItemsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a catalog item. Partial updating is supported. Non-existing items will be created. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+   *   CatalogItem response = catalogServiceClient.updateCatalogItem(formattedName, catalogItem);
+   * }
+   * 
+ * + * @param name Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * @param catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field has + * to match that in the 'name'. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CatalogItem updateCatalogItem(String name, CatalogItem catalogItem) { + CATALOG_ITEM_PATH_PATH_TEMPLATE.validate(name, "updateCatalogItem"); + UpdateCatalogItemRequest request = + UpdateCatalogItemRequest.newBuilder().setName(name).setCatalogItem(catalogItem).build(); + return updateCatalogItem(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a catalog item. Partial updating is supported. Non-existing items will be created. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+   *   UpdateCatalogItemRequest request = UpdateCatalogItemRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setCatalogItem(catalogItem)
+   *     .build();
+   *   CatalogItem response = catalogServiceClient.updateCatalogItem(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 CatalogItem updateCatalogItem(UpdateCatalogItemRequest request) { + return updateCatalogItemCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a catalog item. Partial updating is supported. Non-existing items will be created. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+   *   UpdateCatalogItemRequest request = UpdateCatalogItemRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setCatalogItem(catalogItem)
+   *     .build();
+   *   ApiFuture<CatalogItem> future = catalogServiceClient.updateCatalogItemCallable().futureCall(request);
+   *   // Do something
+   *   CatalogItem response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateCatalogItemCallable() { + return stub.updateCatalogItemCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   catalogServiceClient.deleteCatalogItem(formattedName);
+   * }
+   * 
+ * + * @param name Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCatalogItem(String name) { + CATALOG_ITEM_PATH_PATH_TEMPLATE.validate(name, "deleteCatalogItem"); + DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder().setName(name).build(); + deleteCatalogItem(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   catalogServiceClient.deleteCatalogItem(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 void deleteCatalogItem(DeleteCatalogItemRequest request) { + deleteCatalogItemCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a catalog item. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+   *   DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = catalogServiceClient.deleteCatalogItemCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteCatalogItemCallable() { + return stub.deleteCatalogItemCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of multiple catalog items. Request processing may be synchronous. No partial + * updating supported. Non-existing items will be created. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   String requestId = "";
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
+   *   ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(formattedParent, requestId, inputConfig, errorsConfig).get();
+   * }
+   * 
+ * + * @param parent Required. "projects/1234/locations/global/catalogs/default_catalog" + * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset + * scope. Ensures idempotency and used for request deduplication. Server-generated if + * unspecified. Up to 128 characters long. This is returned as + * google.longrunning.Operation.name in the response. + * @param inputConfig Required. The desired input location of the data. + * @param errorsConfig Optional. The desired location of errors incurred during the Import. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture importCatalogItemsAsync( + String parent, String requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig) { + CATALOG_PATH_TEMPLATE.validate(parent, "importCatalogItems"); + ImportCatalogItemsRequest request = + ImportCatalogItemsRequest.newBuilder() + .setParent(parent) + .setRequestId(requestId) + .setInputConfig(inputConfig) + .setErrorsConfig(errorsConfig) + .build(); + return importCatalogItemsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of multiple catalog items. Request processing may be synchronous. No partial + * updating supported. Non-existing items will be created. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture importCatalogItemsAsync( + ImportCatalogItemsRequest request) { + return importCatalogItemsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of multiple catalog items. Request processing may be synchronous. No partial + * updating supported. Non-existing items will be created. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   OperationFuture<ImportCatalogItemsResponse, ImportMetadata> future = catalogServiceClient.importCatalogItemsOperationCallable().futureCall(request);
+   *   // Do something
+   *   ImportCatalogItemsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationCallable() { + return stub.importCatalogItemsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of multiple catalog items. Request processing may be synchronous. No partial + * updating supported. Non-existing items will be created. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *

Sample code: + * + *


+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = catalogServiceClient.importCatalogItemsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable importCatalogItemsCallable() { + return stub.importCatalogItemsCallable(); + } + + @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); + } + + public static class ListCatalogItemsPagedResponse + extends AbstractPagedListResponse< + ListCatalogItemsRequest, + ListCatalogItemsResponse, + CatalogItem, + ListCatalogItemsPage, + ListCatalogItemsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCatalogItemsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListCatalogItemsPagedResponse apply(ListCatalogItemsPage input) { + return new ListCatalogItemsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListCatalogItemsPagedResponse(ListCatalogItemsPage page) { + super(page, ListCatalogItemsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCatalogItemsPage + extends AbstractPage< + ListCatalogItemsRequest, ListCatalogItemsResponse, CatalogItem, ListCatalogItemsPage> { + + private ListCatalogItemsPage( + PageContext context, + ListCatalogItemsResponse response) { + super(context, response); + } + + private static ListCatalogItemsPage createEmptyPage() { + return new ListCatalogItemsPage(null, null); + } + + @Override + protected ListCatalogItemsPage createPage( + PageContext context, + ListCatalogItemsResponse response) { + return new ListCatalogItemsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCatalogItemsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCatalogItemsRequest, + ListCatalogItemsResponse, + CatalogItem, + ListCatalogItemsPage, + ListCatalogItemsFixedSizeCollection> { + + private ListCatalogItemsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCatalogItemsFixedSizeCollection createEmptyCollection() { + return new ListCatalogItemsFixedSizeCollection(null, 0); + } + + @Override + protected ListCatalogItemsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCatalogItemsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java new file mode 100644 index 00000000..fb44de2a --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java @@ -0,0 +1,261 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.CatalogServiceClient.ListCatalogItemsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.recommendationengine.v1beta1.stub.CatalogServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 CatalogServiceClient}. + * + *

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

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

+ * 
+ * CatalogServiceSettings.Builder catalogServiceSettingsBuilder =
+ *     CatalogServiceSettings.newBuilder();
+ * catalogServiceSettingsBuilder
+ *     .createCatalogItemSettings()
+ *     .setRetrySettings(
+ *         catalogServiceSettingsBuilder.createCatalogItemSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CatalogServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createCatalogItem. */ + public UnaryCallSettings createCatalogItemSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).createCatalogItemSettings(); + } + + /** Returns the object with the settings used for calls to getCatalogItem. */ + public UnaryCallSettings getCatalogItemSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getCatalogItemSettings(); + } + + /** Returns the object with the settings used for calls to listCatalogItems. */ + public PagedCallSettings< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + listCatalogItemsSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).listCatalogItemsSettings(); + } + + /** Returns the object with the settings used for calls to updateCatalogItem. */ + public UnaryCallSettings updateCatalogItemSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateCatalogItemSettings(); + } + + /** Returns the object with the settings used for calls to deleteCatalogItem. */ + public UnaryCallSettings deleteCatalogItemSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).deleteCatalogItemSettings(); + } + + /** Returns the object with the settings used for calls to importCatalogItems. */ + public UnaryCallSettings importCatalogItemsSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsSettings(); + } + + /** Returns the object with the settings used for calls to importCatalogItems. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsOperationSettings(); + } + + public static final CatalogServiceSettings create(CatalogServiceStubSettings stub) + throws IOException { + return new CatalogServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CatalogServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CatalogServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CatalogServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CatalogServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CatalogServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CatalogServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CatalogServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CatalogServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CatalogServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(CatalogServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(CatalogServiceStubSettings.newBuilder()); + } + + protected Builder(CatalogServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CatalogServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public CatalogServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CatalogServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createCatalogItem. */ + public UnaryCallSettings.Builder + createCatalogItemSettings() { + return getStubSettingsBuilder().createCatalogItemSettings(); + } + + /** Returns the builder for the settings used for calls to getCatalogItem. */ + public UnaryCallSettings.Builder getCatalogItemSettings() { + return getStubSettingsBuilder().getCatalogItemSettings(); + } + + /** Returns the builder for the settings used for calls to listCatalogItems. */ + public PagedCallSettings.Builder< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + listCatalogItemsSettings() { + return getStubSettingsBuilder().listCatalogItemsSettings(); + } + + /** Returns the builder for the settings used for calls to updateCatalogItem. */ + public UnaryCallSettings.Builder + updateCatalogItemSettings() { + return getStubSettingsBuilder().updateCatalogItemSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCatalogItem. */ + public UnaryCallSettings.Builder deleteCatalogItemSettings() { + return getStubSettingsBuilder().deleteCatalogItemSettings(); + } + + /** Returns the builder for the settings used for calls to importCatalogItems. */ + public UnaryCallSettings.Builder + importCatalogItemsSettings() { + return getStubSettingsBuilder().importCatalogItemsSettings(); + } + + /** Returns the builder for the settings used for calls to importCatalogItems. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationSettings() { + return getStubSettingsBuilder().importCatalogItemsOperationSettings(); + } + + @Override + public CatalogServiceSettings build() throws IOException { + return new CatalogServiceSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java new file mode 100644 index 00000000..89fd576b --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java @@ -0,0 +1,722 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.recommendationengine.v1beta1.stub.PredictionApiKeyRegistryStub; +import com.google.cloud.recommendationengine.v1beta1.stub.PredictionApiKeyRegistryStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for registering API keys for use with the `predict` method. If you + * use an API key to request predictions, you must first register the API key. Otherwise, your + * prediction request is rejected. If you use OAuth to authenticate your `predict` method call, you + * do not need to register an API key. You can register up to 20 API keys per project. + * + *

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

+ * 
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ *   PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
+ *   PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * PredictionApiKeyRegistrySettings predictionApiKeyRegistrySettings =
+ *     PredictionApiKeyRegistrySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PredictionApiKeyRegistryClient predictionApiKeyRegistryClient =
+ *     PredictionApiKeyRegistryClient.create(predictionApiKeyRegistrySettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * PredictionApiKeyRegistrySettings predictionApiKeyRegistrySettings =
+ *     PredictionApiKeyRegistrySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PredictionApiKeyRegistryClient predictionApiKeyRegistryClient =
+ *     PredictionApiKeyRegistryClient.create(predictionApiKeyRegistrySettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionApiKeyRegistryClient implements BackgroundResource { + private final PredictionApiKeyRegistrySettings settings; + private final PredictionApiKeyRegistryStub stub; + + private static final PathTemplate EVENT_STORE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}"); + + private static final PathTemplate PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}"); + + /** + * Formats a string containing the fully-qualified path to represent a event_store resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String formatEventStoreName( + String project, String location, String catalog, String eventStore) { + return EVENT_STORE_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "catalog", catalog, + "event_store", eventStore); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * prediction_api_key_registration resource. + * + * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead. + */ + @Deprecated + public static final String formatPredictionApiKeyRegistrationName( + String project, + String location, + String catalog, + String eventStore, + String predictionApiKeyRegistration) { + return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "catalog", catalog, + "event_store", eventStore, + "prediction_api_key_registration", predictionApiKeyRegistration); + } + + /** + * Parses the project from the given fully-qualified path which represents a event_store resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseProjectFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a event_store + * resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseLocationFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("location"); + } + + /** + * Parses the catalog from the given fully-qualified path which represents a event_store resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseCatalogFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("catalog"); + } + + /** + * Parses the event_store from the given fully-qualified path which represents a event_store + * resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseEventStoreFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("event_store"); + } + + /** + * Parses the project from the given fully-qualified path which represents a + * prediction_api_key_registration resource. + * + * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead. + */ + @Deprecated + public static final String parseProjectFromPredictionApiKeyRegistrationName( + String predictionApiKeyRegistrationName) { + return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE + .parse(predictionApiKeyRegistrationName) + .get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a + * prediction_api_key_registration resource. + * + * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead. + */ + @Deprecated + public static final String parseLocationFromPredictionApiKeyRegistrationName( + String predictionApiKeyRegistrationName) { + return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE + .parse(predictionApiKeyRegistrationName) + .get("location"); + } + + /** + * Parses the catalog from the given fully-qualified path which represents a + * prediction_api_key_registration resource. + * + * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead. + */ + @Deprecated + public static final String parseCatalogFromPredictionApiKeyRegistrationName( + String predictionApiKeyRegistrationName) { + return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE + .parse(predictionApiKeyRegistrationName) + .get("catalog"); + } + + /** + * Parses the event_store from the given fully-qualified path which represents a + * prediction_api_key_registration resource. + * + * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead. + */ + @Deprecated + public static final String parseEventStoreFromPredictionApiKeyRegistrationName( + String predictionApiKeyRegistrationName) { + return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE + .parse(predictionApiKeyRegistrationName) + .get("event_store"); + } + + /** + * Parses the prediction_api_key_registration from the given fully-qualified path which represents + * a prediction_api_key_registration resource. + * + * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead. + */ + @Deprecated + public static final String parsePredictionApiKeyRegistrationFromPredictionApiKeyRegistrationName( + String predictionApiKeyRegistrationName) { + return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE + .parse(predictionApiKeyRegistrationName) + .get("prediction_api_key_registration"); + } + + /** Constructs an instance of PredictionApiKeyRegistryClient with default settings. */ + public static final PredictionApiKeyRegistryClient create() throws IOException { + return create(PredictionApiKeyRegistrySettings.newBuilder().build()); + } + + /** + * Constructs an instance of PredictionApiKeyRegistryClient, 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 PredictionApiKeyRegistryClient create( + PredictionApiKeyRegistrySettings settings) throws IOException { + return new PredictionApiKeyRegistryClient(settings); + } + + /** + * Constructs an instance of PredictionApiKeyRegistryClient, using the given stub for making + * calls. This is for advanced usage - prefer to use PredictionApiKeyRegistrySettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final PredictionApiKeyRegistryClient create(PredictionApiKeyRegistryStub stub) { + return new PredictionApiKeyRegistryClient(stub); + } + + /** + * Constructs an instance of PredictionApiKeyRegistryClient, 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 PredictionApiKeyRegistryClient(PredictionApiKeyRegistrySettings settings) + throws IOException { + this.settings = settings; + this.stub = ((PredictionApiKeyRegistryStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected PredictionApiKeyRegistryClient(PredictionApiKeyRegistryStub stub) { + this.settings = null; + this.stub = stub; + } + + public final PredictionApiKeyRegistrySettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PredictionApiKeyRegistryStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Register an API key for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
+   *   PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration);
+   * }
+   * 
+ * + * @param parent Required. The parent resource path. + * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store". + * @param predictionApiKeyRegistration Required. The prediction API key registration. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PredictionApiKeyRegistration createPredictionApiKeyRegistration( + String parent, PredictionApiKeyRegistration predictionApiKeyRegistration) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "createPredictionApiKeyRegistration"); + CreatePredictionApiKeyRegistrationRequest request = + CreatePredictionApiKeyRegistrationRequest.newBuilder() + .setParent(parent) + .setPredictionApiKeyRegistration(predictionApiKeyRegistration) + .build(); + return createPredictionApiKeyRegistration(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Register an API key for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
+   *   CreatePredictionApiKeyRegistrationRequest request = CreatePredictionApiKeyRegistrationRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setPredictionApiKeyRegistration(predictionApiKeyRegistration)
+   *     .build();
+   *   PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(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 PredictionApiKeyRegistration createPredictionApiKeyRegistration( + CreatePredictionApiKeyRegistrationRequest request) { + return createPredictionApiKeyRegistrationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Register an API key for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
+   *   CreatePredictionApiKeyRegistrationRequest request = CreatePredictionApiKeyRegistrationRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setPredictionApiKeyRegistration(predictionApiKeyRegistration)
+   *     .build();
+   *   ApiFuture<PredictionApiKeyRegistration> future = predictionApiKeyRegistryClient.createPredictionApiKeyRegistrationCallable().futureCall(request);
+   *   // Do something
+   *   PredictionApiKeyRegistration response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationCallable() { + return stub.createPredictionApiKeyRegistrationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the registered apiKeys for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   for (PredictionApiKeyRegistration element : predictionApiKeyRegistryClient.listPredictionApiKeyRegistrations(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent placement resource name such as + * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKeyRegistrations( + String parent) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "listPredictionApiKeyRegistrations"); + ListPredictionApiKeyRegistrationsRequest request = + ListPredictionApiKeyRegistrationsRequest.newBuilder().setParent(parent).build(); + return listPredictionApiKeyRegistrations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the registered apiKeys for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   ListPredictionApiKeyRegistrationsRequest request = ListPredictionApiKeyRegistrationsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (PredictionApiKeyRegistration element : predictionApiKeyRegistryClient.listPredictionApiKeyRegistrations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKeyRegistrations( + ListPredictionApiKeyRegistrationsRequest request) { + return listPredictionApiKeyRegistrationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the registered apiKeys for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   ListPredictionApiKeyRegistrationsRequest request = ListPredictionApiKeyRegistrationsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListPredictionApiKeyRegistrationsPagedResponse> future = predictionApiKeyRegistryClient.listPredictionApiKeyRegistrationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (PredictionApiKeyRegistration element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsPagedCallable() { + return stub.listPredictionApiKeyRegistrationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List the registered apiKeys for use with predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   ListPredictionApiKeyRegistrationsRequest request = ListPredictionApiKeyRegistrationsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListPredictionApiKeyRegistrationsResponse response = predictionApiKeyRegistryClient.listPredictionApiKeyRegistrationsCallable().call(request);
+   *     for (PredictionApiKeyRegistration element : response.getPredictionApiKeyRegistrationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrationsCallable() { + return stub.listPredictionApiKeyRegistrationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Unregister an apiKey from using for predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedName = PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+   *   predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(formattedName);
+   * }
+   * 
+ * + * @param name Required. The API key to unregister including full resource path. + * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePredictionApiKeyRegistration(String name) { + PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE.validate( + name, "deletePredictionApiKeyRegistration"); + DeletePredictionApiKeyRegistrationRequest request = + DeletePredictionApiKeyRegistrationRequest.newBuilder().setName(name).build(); + deletePredictionApiKeyRegistration(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Unregister an apiKey from using for predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedName = PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+   *   DeletePredictionApiKeyRegistrationRequest request = DeletePredictionApiKeyRegistrationRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(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 void deletePredictionApiKeyRegistration( + DeletePredictionApiKeyRegistrationRequest request) { + deletePredictionApiKeyRegistrationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Unregister an apiKey from using for predict method. + * + *

Sample code: + * + *


+   * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+   *   String formattedName = PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+   *   DeletePredictionApiKeyRegistrationRequest request = DeletePredictionApiKeyRegistrationRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = predictionApiKeyRegistryClient.deletePredictionApiKeyRegistrationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deletePredictionApiKeyRegistrationCallable() { + return stub.deletePredictionApiKeyRegistrationCallable(); + } + + @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); + } + + public static class ListPredictionApiKeyRegistrationsPagedResponse + extends AbstractPagedListResponse< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration, + ListPredictionApiKeyRegistrationsPage, + ListPredictionApiKeyRegistrationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPredictionApiKeyRegistrationsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction< + ListPredictionApiKeyRegistrationsPage, + ListPredictionApiKeyRegistrationsPagedResponse>() { + @Override + public ListPredictionApiKeyRegistrationsPagedResponse apply( + ListPredictionApiKeyRegistrationsPage input) { + return new ListPredictionApiKeyRegistrationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListPredictionApiKeyRegistrationsPagedResponse( + ListPredictionApiKeyRegistrationsPage page) { + super(page, ListPredictionApiKeyRegistrationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPredictionApiKeyRegistrationsPage + extends AbstractPage< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration, + ListPredictionApiKeyRegistrationsPage> { + + private ListPredictionApiKeyRegistrationsPage( + PageContext< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration> + context, + ListPredictionApiKeyRegistrationsResponse response) { + super(context, response); + } + + private static ListPredictionApiKeyRegistrationsPage createEmptyPage() { + return new ListPredictionApiKeyRegistrationsPage(null, null); + } + + @Override + protected ListPredictionApiKeyRegistrationsPage createPage( + PageContext< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration> + context, + ListPredictionApiKeyRegistrationsResponse response) { + return new ListPredictionApiKeyRegistrationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPredictionApiKeyRegistrationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration, + ListPredictionApiKeyRegistrationsPage, + ListPredictionApiKeyRegistrationsFixedSizeCollection> { + + private ListPredictionApiKeyRegistrationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPredictionApiKeyRegistrationsFixedSizeCollection createEmptyCollection() { + return new ListPredictionApiKeyRegistrationsFixedSizeCollection(null, 0); + } + + @Override + protected ListPredictionApiKeyRegistrationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPredictionApiKeyRegistrationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java new file mode 100644 index 00000000..e1669db9 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java @@ -0,0 +1,226 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.recommendationengine.v1beta1.stub.PredictionApiKeyRegistryStubSettings; +import com.google.protobuf.Empty; +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 PredictionApiKeyRegistryClient}. + * + *

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

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

+ * 
+ * PredictionApiKeyRegistrySettings.Builder predictionApiKeyRegistrySettingsBuilder =
+ *     PredictionApiKeyRegistrySettings.newBuilder();
+ * predictionApiKeyRegistrySettingsBuilder
+ *     .createPredictionApiKeyRegistrationSettings()
+ *     .setRetrySettings(
+ *         predictionApiKeyRegistrySettingsBuilder.createPredictionApiKeyRegistrationSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionApiKeyRegistrySettings predictionApiKeyRegistrySettings = predictionApiKeyRegistrySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionApiKeyRegistrySettings + extends ClientSettings { + /** Returns the object with the settings used for calls to createPredictionApiKeyRegistration. */ + public UnaryCallSettings + createPredictionApiKeyRegistrationSettings() { + return ((PredictionApiKeyRegistryStubSettings) getStubSettings()) + .createPredictionApiKeyRegistrationSettings(); + } + + /** Returns the object with the settings used for calls to listPredictionApiKeyRegistrations. */ + public PagedCallSettings< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsSettings() { + return ((PredictionApiKeyRegistryStubSettings) getStubSettings()) + .listPredictionApiKeyRegistrationsSettings(); + } + + /** Returns the object with the settings used for calls to deletePredictionApiKeyRegistration. */ + public UnaryCallSettings + deletePredictionApiKeyRegistrationSettings() { + return ((PredictionApiKeyRegistryStubSettings) getStubSettings()) + .deletePredictionApiKeyRegistrationSettings(); + } + + public static final PredictionApiKeyRegistrySettings create( + PredictionApiKeyRegistryStubSettings stub) throws IOException { + return new PredictionApiKeyRegistrySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PredictionApiKeyRegistryStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PredictionApiKeyRegistryStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PredictionApiKeyRegistryStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PredictionApiKeyRegistryStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PredictionApiKeyRegistryStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PredictionApiKeyRegistryStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionApiKeyRegistryStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionApiKeyRegistrySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PredictionApiKeyRegistrySettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(PredictionApiKeyRegistryStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(PredictionApiKeyRegistryStubSettings.newBuilder()); + } + + protected Builder(PredictionApiKeyRegistrySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PredictionApiKeyRegistryStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public PredictionApiKeyRegistryStubSettings.Builder getStubSettingsBuilder() { + return ((PredictionApiKeyRegistryStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to createPredictionApiKeyRegistration. + */ + public UnaryCallSettings.Builder< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationSettings() { + return getStubSettingsBuilder().createPredictionApiKeyRegistrationSettings(); + } + + /** Returns the builder for the settings used for calls to listPredictionApiKeyRegistrations. */ + public PagedCallSettings.Builder< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsSettings() { + return getStubSettingsBuilder().listPredictionApiKeyRegistrationsSettings(); + } + + /** + * Returns the builder for the settings used for calls to deletePredictionApiKeyRegistration. + */ + public UnaryCallSettings.Builder + deletePredictionApiKeyRegistrationSettings() { + return getStubSettingsBuilder().deletePredictionApiKeyRegistrationSettings(); + } + + @Override + public PredictionApiKeyRegistrySettings build() throws IOException { + return new PredictionApiKeyRegistrySettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java new file mode 100644 index 00000000..67c71b95 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java @@ -0,0 +1,443 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.recommendationengine.v1beta1.stub.PredictionServiceStub; +import com.google.cloud.recommendationengine.v1beta1.stub.PredictionServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for making recommendation prediction. + * + *

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

+ * 
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ *   UserEvent userEvent = UserEvent.newBuilder().build();
+ *   PredictRequest request = PredictRequest.newBuilder()
+ *     .setName(formattedName)
+ *     .setUserEvent(userEvent)
+ *     .build();
+ *   ApiFuture<PredictPagedResponse> future = predictionServiceClient.predictPagedCallable().futureCall(request);
+ *   // Do something
+ *   for (PredictResponse.PredictionResult element : future.get().iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionServiceClient implements BackgroundResource { + private final PredictionServiceSettings settings; + private final PredictionServiceStub stub; + + private static final PathTemplate PLACEMENT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}"); + + /** + * Formats a string containing the fully-qualified path to represent a placement resource. + * + * @deprecated Use the {@link PlacementName} class instead. + */ + @Deprecated + public static final String formatPlacementName( + String project, String location, String catalog, String eventStore, String placement) { + return PLACEMENT_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "catalog", catalog, + "event_store", eventStore, + "placement", placement); + } + + /** + * Parses the project from the given fully-qualified path which represents a placement resource. + * + * @deprecated Use the {@link PlacementName} class instead. + */ + @Deprecated + public static final String parseProjectFromPlacementName(String placementName) { + return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a placement resource. + * + * @deprecated Use the {@link PlacementName} class instead. + */ + @Deprecated + public static final String parseLocationFromPlacementName(String placementName) { + return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("location"); + } + + /** + * Parses the catalog from the given fully-qualified path which represents a placement resource. + * + * @deprecated Use the {@link PlacementName} class instead. + */ + @Deprecated + public static final String parseCatalogFromPlacementName(String placementName) { + return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("catalog"); + } + + /** + * Parses the event_store from the given fully-qualified path which represents a placement + * resource. + * + * @deprecated Use the {@link PlacementName} class instead. + */ + @Deprecated + public static final String parseEventStoreFromPlacementName(String placementName) { + return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("event_store"); + } + + /** + * Parses the placement from the given fully-qualified path which represents a placement resource. + * + * @deprecated Use the {@link PlacementName} class instead. + */ + @Deprecated + public static final String parsePlacementFromPlacementName(String placementName) { + return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("placement"); + } + + /** Constructs an instance of PredictionServiceClient with default settings. */ + public static final PredictionServiceClient create() throws IOException { + return create(PredictionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient create(PredictionServiceSettings settings) + throws IOException { + return new PredictionServiceClient(settings); + } + + /** + * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use PredictionServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final PredictionServiceClient create(PredictionServiceStub stub) { + return new PredictionServiceClient(stub); + } + + /** + * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient(PredictionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected PredictionServiceClient(PredictionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final PredictionServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PredictionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes a recommendation prediction. If using API Key based authentication, the API Key must be + * registered using the + * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] + * service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+   *   UserEvent userEvent = UserEvent.newBuilder().build();
+   *   PredictRequest request = PredictRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   for (PredictResponse.PredictionResult element : predictionServiceClient.predict(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 PredictPagedResponse predict(PredictRequest request) { + return predictPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes a recommendation prediction. If using API Key based authentication, the API Key must be + * registered using the + * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] + * service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+   *   UserEvent userEvent = UserEvent.newBuilder().build();
+   *   PredictRequest request = PredictRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   ApiFuture<PredictPagedResponse> future = predictionServiceClient.predictPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (PredictResponse.PredictionResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable predictPagedCallable() { + return stub.predictPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes a recommendation prediction. If using API Key based authentication, the API Key must be + * registered using the + * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] + * service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + * + *

Sample code: + * + *


+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+   *   UserEvent userEvent = UserEvent.newBuilder().build();
+   *   PredictRequest request = PredictRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   while (true) {
+   *     PredictResponse response = predictionServiceClient.predictCallable().call(request);
+   *     for (PredictResponse.PredictionResult element : response.getResultsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable predictCallable() { + return stub.predictCallable(); + } + + @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); + } + + public static class PredictPagedResponse + extends AbstractPagedListResponse< + PredictRequest, + PredictResponse, + PredictResponse.PredictionResult, + PredictPage, + PredictFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PredictPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public PredictPagedResponse apply(PredictPage input) { + return new PredictPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private PredictPagedResponse(PredictPage page) { + super(page, PredictFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PredictPage + extends AbstractPage< + PredictRequest, PredictResponse, PredictResponse.PredictionResult, PredictPage> { + + private PredictPage( + PageContext context, + PredictResponse response) { + super(context, response); + } + + private static PredictPage createEmptyPage() { + return new PredictPage(null, null); + } + + @Override + protected PredictPage createPage( + PageContext context, + PredictResponse response) { + return new PredictPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PredictFixedSizeCollection + extends AbstractFixedSizeCollection< + PredictRequest, + PredictResponse, + PredictResponse.PredictionResult, + PredictPage, + PredictFixedSizeCollection> { + + private PredictFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PredictFixedSizeCollection createEmptyCollection() { + return new PredictFixedSizeCollection(null, 0); + } + + @Override + protected PredictFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PredictFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java new file mode 100644 index 00000000..cecd5685 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java @@ -0,0 +1,185 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionServiceClient.PredictPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.recommendationengine.v1beta1.stub.PredictionServiceStubSettings; +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 PredictionServiceClient}. + * + *

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

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

+ * 
+ * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder.predictSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to predict. */ + public PagedCallSettings + predictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).predictSettings(); + } + + public static final PredictionServiceSettings create(PredictionServiceStubSettings stub) + throws IOException { + return new PredictionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PredictionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PredictionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PredictionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PredictionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PredictionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PredictionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PredictionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(PredictionServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(PredictionServiceStubSettings.newBuilder()); + } + + protected Builder(PredictionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PredictionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public PredictionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((PredictionServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to predict. */ + public PagedCallSettings.Builder + predictSettings() { + return getStubSettingsBuilder().predictSettings(); + } + + @Override + public PredictionServiceSettings build() throws IOException { + return new PredictionServiceSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java new file mode 100644 index 00000000..99f0d1cc --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java @@ -0,0 +1,923 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.recommendationengine.v1beta1.stub.UserEventServiceStub; +import com.google.cloud.recommendationengine.v1beta1.stub.UserEventServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for ingesting end user actions on the customer website. + * + *

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

+ * 
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ *   UserEvent userEvent = UserEvent.newBuilder().build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(formattedParent, userEvent);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * UserEventServiceSettings userEventServiceSettings =
+ *     UserEventServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * UserEventServiceClient userEventServiceClient =
+ *     UserEventServiceClient.create(userEventServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * UserEventServiceSettings userEventServiceSettings =
+ *     UserEventServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * UserEventServiceClient userEventServiceClient =
+ *     UserEventServiceClient.create(userEventServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class UserEventServiceClient implements BackgroundResource { + private final UserEventServiceSettings settings; + private final UserEventServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate EVENT_STORE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}"); + + /** + * Formats a string containing the fully-qualified path to represent a event_store resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String formatEventStoreName( + String project, String location, String catalog, String eventStore) { + return EVENT_STORE_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "catalog", catalog, + "event_store", eventStore); + } + + /** + * Parses the project from the given fully-qualified path which represents a event_store resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseProjectFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a event_store + * resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseLocationFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("location"); + } + + /** + * Parses the catalog from the given fully-qualified path which represents a event_store resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseCatalogFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("catalog"); + } + + /** + * Parses the event_store from the given fully-qualified path which represents a event_store + * resource. + * + * @deprecated Use the {@link EventStoreName} class instead. + */ + @Deprecated + public static final String parseEventStoreFromEventStoreName(String eventStoreName) { + return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("event_store"); + } + + /** Constructs an instance of UserEventServiceClient with default settings. */ + public static final UserEventServiceClient create() throws IOException { + return create(UserEventServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient create(UserEventServiceSettings settings) + throws IOException { + return new UserEventServiceClient(settings); + } + + /** + * Constructs an instance of UserEventServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use UserEventServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final UserEventServiceClient create(UserEventServiceStub stub) { + return new UserEventServiceClient(stub); + } + + /** + * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient(UserEventServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((UserEventServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected UserEventServiceClient(UserEventServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final UserEventServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public UserEventServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes a single user event. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   UserEvent userEvent = UserEvent.newBuilder().build();
+   *   UserEvent response = userEventServiceClient.writeUserEvent(formattedParent, userEvent);
+   * }
+   * 
+ * + * @param parent Required. The parent eventStore resource name, such as + * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store". + * @param userEvent Required. User event to write. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final UserEvent writeUserEvent(String parent, UserEvent userEvent) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "writeUserEvent"); + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder().setParent(parent).setUserEvent(userEvent).build(); + return writeUserEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes a single user event. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   UserEvent userEvent = UserEvent.newBuilder().build();
+   *   WriteUserEventRequest request = WriteUserEventRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   UserEvent response = userEventServiceClient.writeUserEvent(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 UserEvent writeUserEvent(WriteUserEventRequest request) { + return writeUserEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes a single user event. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   UserEvent userEvent = UserEvent.newBuilder().build();
+   *   WriteUserEventRequest request = WriteUserEventRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   ApiFuture<UserEvent> future = userEventServiceClient.writeUserEventCallable().futureCall(request);
+   *   // Do something
+   *   UserEvent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable writeUserEventCallable() { + return stub.writeUserEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

This method is used only by the Recommendations AI JavaScript pixel. Users should not call + * this method directly. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String userEvent = "";
+   *   String uri = "";
+   *   long ets = 0L;
+   *   HttpBody response = userEventServiceClient.collectUserEvent(formattedParent, userEvent, uri, ets);
+   * }
+   * 
+ * + * @param parent Required. The parent eventStore name, such as + * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store". + * @param userEvent Required. URL encoded UserEvent proto. + * @param uri Optional. The url including cgi-parameters but excluding the hash fragment. The URL + * must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more + * useful than the referer url, because many browsers only send the domain for 3rd party + * requests. + * @param ets Optional. The event timestamp in milliseconds. This prevents browser caching of + * otherwise identical get requests. The name is abbreviated to reduce the payload bytes. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HttpBody collectUserEvent(String parent, String userEvent, String uri, long ets) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "collectUserEvent"); + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent(parent) + .setUserEvent(userEvent) + .setUri(uri) + .setEts(ets) + .build(); + return collectUserEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

This method is used only by the Recommendations AI JavaScript pixel. Users should not call + * this method directly. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String userEvent = "";
+   *   CollectUserEventRequest request = CollectUserEventRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   HttpBody response = userEventServiceClient.collectUserEvent(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 HttpBody collectUserEvent(CollectUserEventRequest request) { + return collectUserEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

This method is used only by the Recommendations AI JavaScript pixel. Users should not call + * this method directly. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String userEvent = "";
+   *   CollectUserEventRequest request = CollectUserEventRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setUserEvent(userEvent)
+   *     .build();
+   *   ApiFuture<HttpBody> future = userEventServiceClient.collectUserEventCallable().futureCall(request);
+   *   // Do something
+   *   HttpBody response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable collectUserEventCallable() { + return stub.collectUserEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of user events within a time range, with potential filtering. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String filter = "";
+   *   for (UserEvent element : userEventServiceClient.listUserEvents(formattedParent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent eventStore resource name, such as + * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store". + * @param filter Optional. Filtering expression to specify restrictions over returned events. This + * is a sequence of terms, where each term applies some kind of a restriction to the returned + * user events. Use this expression to restrict results to a specific time range, or filter + * events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z" + * eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search + *

We expect only 3 types of fields: + *

* eventTime: this can be specified a maximum of 2 times, once with a less than + * operator and once with a greater than operator. The eventTime restrict should result in one + * contiguous valid eventTime range. + *

* eventType: only 1 eventType restriction can be specified. + *

* eventsMissingCatalogItems: specififying this will restrict results to events for + * which catalog items were not found in the catalog. The default behavior is to return only + * those events for which catalog items were found. + *

Some examples of valid filters expressions: + *

* Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime < + * "2012-04-23T18:30:43.511Z" * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + * eventType = detail-page-view * Example 3: eventsMissingCatalogItems eventType = search + * eventTime < "2018-04-23T18:30:43.511Z" * Example 4: eventTime > + * "2012-04-23T18:25:43.511Z" * Example 5: eventType = search * Example 6: + * eventsMissingCatalogItems + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUserEventsPagedResponse listUserEvents(String parent, String filter) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "listUserEvents"); + ListUserEventsRequest request = + ListUserEventsRequest.newBuilder().setParent(parent).setFilter(filter).build(); + return listUserEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of user events within a time range, with potential filtering. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (UserEvent element : userEventServiceClient.listUserEvents(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListUserEventsPagedResponse listUserEvents(ListUserEventsRequest request) { + return listUserEventsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of user events within a time range, with potential filtering. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListUserEventsPagedResponse> future = userEventServiceClient.listUserEventsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (UserEvent element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listUserEventsPagedCallable() { + return stub.listUserEventsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a list of user events within a time range, with potential filtering. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListUserEventsResponse response = userEventServiceClient.listUserEventsCallable().call(request);
+   *     for (UserEvent element : response.getUserEventsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listUserEventsCallable() { + return stub.listUserEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String filter = "";
+   *   boolean force = false;
+   *   PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(formattedParent, filter, force).get();
+   * }
+   * 
+ * + * @param parent Required. The resource name of the event_store under which the events are + * created. The format is + * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}" + * @param filter Required. The filter string to specify the events to be deleted. Empty string + * filter is not allowed. This filter can also be used with ListUserEvents API to list events + * that will be deleted. The eligible fields for filtering are: * eventType - + * UserEvent.eventType field of type string. * eventTime - in ISO 8601 "zulu" format. + * * visitorId - field of type string. Specifying this will delete all events associated + * with a visitor. * userId - field of type string. Specifying this will delete all events + * associated with a user. Example 1: Deleting all events in a time range. `eventTime > + * "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"` Example 2: Deleting + * specific eventType in time range. `eventTime > "2012-04-23T18:25:43.511Z" eventType = + * "detail-page-view"` Example 3: Deleting all events for a specific visitor `visitorId = + * visitor1024` The filtering fields are assumed to have an implicit AND. + * @param force Optional. The default value is false. Override this flag to true to actually + * perform the purge. If the field is not set to true, a sampling of events to be deleted will + * be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture + purgeUserEventsAsync(String parent, String filter, boolean force) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "purgeUserEvents"); + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent(parent) + .setFilter(filter) + .setForce(force) + .build(); + return purgeUserEventsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String filter = "";
+   *   PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setFilter(filter)
+   *     .build();
+   *   PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture + purgeUserEventsAsync(PurgeUserEventsRequest request) { + return purgeUserEventsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String filter = "";
+   *   PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setFilter(filter)
+   *     .build();
+   *   OperationFuture<PurgeUserEventsResponse, PurgeUserEventsMetadata> future = userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request);
+   *   // Do something
+   *   PurgeUserEventsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationCallable() { + return stub.purgeUserEventsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String filter = "";
+   *   PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setFilter(filter)
+   *     .build();
+   *   ApiFuture<Operation> future = userEventServiceClient.purgeUserEventsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable purgeUserEventsCallable() { + return stub.purgeUserEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of User events. Request processing might be synchronous. Events that already exist + * are skipped. Use this method for backfilling historical user events. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully inserted. Operation.metadata is of type ImportMetadata. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   String requestId = "";
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
+   *   ImportUserEventsResponse response = userEventServiceClient.importUserEventsAsync(formattedParent, requestId, inputConfig, errorsConfig).get();
+   * }
+   * 
+ * + * @param parent Required. + * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store" + * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset + * scope. Ensures idempotency for expensive long running operations. Server-generated if + * unspecified. Up to 128 characters long. This is returned as + * google.longrunning.Operation.name in the response. Note that this field must not be set if + * the desired input config is catalog_inline_source. + * @param inputConfig Required. The desired input location of the data. + * @param errorsConfig Optional. The desired location of errors incurred during the Import. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture importUserEventsAsync( + String parent, String requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig) { + EVENT_STORE_PATH_TEMPLATE.validate(parent, "importUserEvents"); + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent(parent) + .setRequestId(requestId) + .setInputConfig(inputConfig) + .setErrorsConfig(errorsConfig) + .build(); + return importUserEventsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of User events. Request processing might be synchronous. Events that already exist + * are skipped. Use this method for backfilling historical user events. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully inserted. Operation.metadata is of type ImportMetadata. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ImportUserEventsResponse response = userEventServiceClient.importUserEventsAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture importUserEventsAsync( + ImportUserEventsRequest request) { + return importUserEventsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of User events. Request processing might be synchronous. Events that already exist + * are skipped. Use this method for backfilling historical user events. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully inserted. Operation.metadata is of type ImportMetadata. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   OperationFuture<ImportUserEventsResponse, ImportMetadata> future = userEventServiceClient.importUserEventsOperationCallable().futureCall(request);
+   *   // Do something
+   *   ImportUserEventsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + importUserEventsOperationCallable() { + return stub.importUserEventsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Bulk import of User events. Request processing might be synchronous. Events that already exist + * are skipped. Use this method for backfilling historical user events. + * + *

Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully inserted. Operation.metadata is of type ImportMetadata. + * + *

Sample code: + * + *


+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = userEventServiceClient.importUserEventsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable importUserEventsCallable() { + return stub.importUserEventsCallable(); + } + + @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); + } + + public static class ListUserEventsPagedResponse + extends AbstractPagedListResponse< + ListUserEventsRequest, + ListUserEventsResponse, + UserEvent, + ListUserEventsPage, + ListUserEventsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUserEventsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListUserEventsPagedResponse apply(ListUserEventsPage input) { + return new ListUserEventsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListUserEventsPagedResponse(ListUserEventsPage page) { + super(page, ListUserEventsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUserEventsPage + extends AbstractPage< + ListUserEventsRequest, ListUserEventsResponse, UserEvent, ListUserEventsPage> { + + private ListUserEventsPage( + PageContext context, + ListUserEventsResponse response) { + super(context, response); + } + + private static ListUserEventsPage createEmptyPage() { + return new ListUserEventsPage(null, null); + } + + @Override + protected ListUserEventsPage createPage( + PageContext context, + ListUserEventsResponse response) { + return new ListUserEventsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUserEventsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUserEventsRequest, + ListUserEventsResponse, + UserEvent, + ListUserEventsPage, + ListUserEventsFixedSizeCollection> { + + private ListUserEventsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUserEventsFixedSizeCollection createEmptyCollection() { + return new ListUserEventsFixedSizeCollection(null, 0); + } + + @Override + protected ListUserEventsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUserEventsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java new file mode 100644 index 00000000..8d861f9e --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java @@ -0,0 +1,266 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.UserEventServiceClient.ListUserEventsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.recommendationengine.v1beta1.stub.UserEventServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link UserEventServiceClient}. + * + *

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

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

+ * 
+ * UserEventServiceSettings.Builder userEventServiceSettingsBuilder =
+ *     UserEventServiceSettings.newBuilder();
+ * userEventServiceSettingsBuilder
+ *     .writeUserEventSettings()
+ *     .setRetrySettings(
+ *         userEventServiceSettingsBuilder.writeUserEventSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * UserEventServiceSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class UserEventServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to writeUserEvent. */ + public UnaryCallSettings writeUserEventSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).writeUserEventSettings(); + } + + /** Returns the object with the settings used for calls to collectUserEvent. */ + public UnaryCallSettings collectUserEventSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).collectUserEventSettings(); + } + + /** Returns the object with the settings used for calls to listUserEvents. */ + public PagedCallSettings< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + listUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).listUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings purgeUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsOperationSettings(); + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public UnaryCallSettings importUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + importUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsOperationSettings(); + } + + public static final UserEventServiceSettings create(UserEventServiceStubSettings stub) + throws IOException { + return new UserEventServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return UserEventServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return UserEventServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return UserEventServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return UserEventServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return UserEventServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return UserEventServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return UserEventServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected UserEventServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for UserEventServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(UserEventServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(UserEventServiceStubSettings.newBuilder()); + } + + protected Builder(UserEventServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(UserEventServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public UserEventServiceStubSettings.Builder getStubSettingsBuilder() { + return ((UserEventServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to writeUserEvent. */ + public UnaryCallSettings.Builder writeUserEventSettings() { + return getStubSettingsBuilder().writeUserEventSettings(); + } + + /** Returns the builder for the settings used for calls to collectUserEvent. */ + public UnaryCallSettings.Builder collectUserEventSettings() { + return getStubSettingsBuilder().collectUserEventSettings(); + } + + /** Returns the builder for the settings used for calls to listUserEvents. */ + public PagedCallSettings.Builder< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + listUserEventsSettings() { + return getStubSettingsBuilder().listUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings.Builder purgeUserEventsSettings() { + return getStubSettingsBuilder().purgeUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings() { + return getStubSettingsBuilder().purgeUserEventsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public UnaryCallSettings.Builder + importUserEventsSettings() { + return getStubSettingsBuilder().importUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings() { + return getStubSettingsBuilder().importUserEventsOperationSettings(); + } + + @Override + public UserEventServiceSettings build() throws IOException { + return new UserEventServiceSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java new file mode 100644 index 00000000..86fcfdb8 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Recommendations AI. + * + *

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

==================== CatalogServiceClient ==================== + * + *

Service Description: Service for ingesting catalog information of the customer's website. + * + *

Sample for CatalogServiceClient: + * + *

+ * 
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ *   String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   CatalogItem catalogItem = CatalogItem.newBuilder().build();
+ *   CatalogItem response = catalogServiceClient.createCatalogItem(formattedParent, catalogItem);
+ * }
+ * 
+ * 
+ * + * ============================== PredictionApiKeyRegistryClient ============================== + * + *

Service Description: Service for registering API keys for use with the `predict` method. If + * you use an API key to request predictions, you must first register the API key. Otherwise, your + * prediction request is rejected. If you use OAuth to authenticate your `predict` method call, you + * do not need to register an API key. You can register up to 20 API keys per project. + * + *

Sample for PredictionApiKeyRegistryClient: + * + *

+ * 
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ *   String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ *   PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
+ *   PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration);
+ * }
+ * 
+ * 
+ * + * ======================= PredictionServiceClient ======================= + * + *

Service Description: Service for making recommendation prediction. + * + *

Sample for PredictionServiceClient: + * + *

+ * 
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ *   UserEvent userEvent = UserEvent.newBuilder().build();
+ *   PredictRequest request = PredictRequest.newBuilder()
+ *     .setName(formattedName)
+ *     .setUserEvent(userEvent)
+ *     .build();
+ *   PredictPagedResponse response = predictionServiceClient.predictPagedCallable(request);
+ * }
+ * 
+ * 
+ * + * ====================== UserEventServiceClient ====================== + * + *

Service Description: Service for ingesting end user actions on the customer website. + * + *

Sample for UserEventServiceClient: + * + *

+ * 
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ *   UserEvent userEvent = UserEvent.newBuilder().build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(formattedParent, userEvent);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.recommendationengine.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java new file mode 100644 index 00000000..944c833b --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java @@ -0,0 +1,93 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.CatalogServiceClient.ListCatalogItemsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CatalogItem; +import com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse; +import com.google.cloud.recommendationengine.v1beta1.ImportMetadata; +import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse; +import com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class CatalogServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createCatalogItemCallable() { + throw new UnsupportedOperationException("Not implemented: createCatalogItemCallable()"); + } + + public UnaryCallable getCatalogItemCallable() { + throw new UnsupportedOperationException("Not implemented: getCatalogItemCallable()"); + } + + public UnaryCallable + listCatalogItemsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCatalogItemsPagedCallable()"); + } + + public UnaryCallable + listCatalogItemsCallable() { + throw new UnsupportedOperationException("Not implemented: listCatalogItemsCallable()"); + } + + public UnaryCallable updateCatalogItemCallable() { + throw new UnsupportedOperationException("Not implemented: updateCatalogItemCallable()"); + } + + public UnaryCallable deleteCatalogItemCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCatalogItemCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + importCatalogItemsOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: importCatalogItemsOperationCallable()"); + } + + public UnaryCallable importCatalogItemsCallable() { + throw new UnsupportedOperationException("Not implemented: importCatalogItemsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java new file mode 100644 index 00000000..5745275c --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java @@ -0,0 +1,539 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.CatalogServiceClient.ListCatalogItemsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CatalogItem; +import com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse; +import com.google.cloud.recommendationengine.v1beta1.ImportMetadata; +import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse; +import com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 CatalogServiceStub}. + * + *

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

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

+ * 
+ * CatalogServiceStubSettings.Builder catalogServiceSettingsBuilder =
+ *     CatalogServiceStubSettings.newBuilder();
+ * catalogServiceSettingsBuilder
+ *     .createCatalogItemSettings()
+ *     .setRetrySettings(
+ *         catalogServiceSettingsBuilder.createCatalogItemSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CatalogServiceStubSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CatalogServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createCatalogItemSettings; + private final UnaryCallSettings getCatalogItemSettings; + private final PagedCallSettings< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + listCatalogItemsSettings; + private final UnaryCallSettings updateCatalogItemSettings; + private final UnaryCallSettings deleteCatalogItemSettings; + private final UnaryCallSettings importCatalogItemsSettings; + private final OperationCallSettings< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationSettings; + + /** Returns the object with the settings used for calls to createCatalogItem. */ + public UnaryCallSettings createCatalogItemSettings() { + return createCatalogItemSettings; + } + + /** Returns the object with the settings used for calls to getCatalogItem. */ + public UnaryCallSettings getCatalogItemSettings() { + return getCatalogItemSettings; + } + + /** Returns the object with the settings used for calls to listCatalogItems. */ + public PagedCallSettings< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + listCatalogItemsSettings() { + return listCatalogItemsSettings; + } + + /** Returns the object with the settings used for calls to updateCatalogItem. */ + public UnaryCallSettings updateCatalogItemSettings() { + return updateCatalogItemSettings; + } + + /** Returns the object with the settings used for calls to deleteCatalogItem. */ + public UnaryCallSettings deleteCatalogItemSettings() { + return deleteCatalogItemSettings; + } + + /** Returns the object with the settings used for calls to importCatalogItems. */ + public UnaryCallSettings importCatalogItemsSettings() { + return importCatalogItemsSettings; + } + + /** Returns the object with the settings used for calls to importCatalogItems. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationSettings() { + return importCatalogItemsOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CatalogServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCatalogServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "recommendationengine.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CatalogServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CatalogServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createCatalogItemSettings = settingsBuilder.createCatalogItemSettings().build(); + getCatalogItemSettings = settingsBuilder.getCatalogItemSettings().build(); + listCatalogItemsSettings = settingsBuilder.listCatalogItemsSettings().build(); + updateCatalogItemSettings = settingsBuilder.updateCatalogItemSettings().build(); + deleteCatalogItemSettings = settingsBuilder.deleteCatalogItemSettings().build(); + importCatalogItemsSettings = settingsBuilder.importCatalogItemsSettings().build(); + importCatalogItemsOperationSettings = + settingsBuilder.importCatalogItemsOperationSettings().build(); + } + + private static final PagedListDescriptor< + ListCatalogItemsRequest, ListCatalogItemsResponse, CatalogItem> + LIST_CATALOG_ITEMS_PAGE_STR_DESC = + new PagedListDescriptor< + ListCatalogItemsRequest, ListCatalogItemsResponse, CatalogItem>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCatalogItemsRequest injectToken( + ListCatalogItemsRequest payload, String token) { + return ListCatalogItemsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCatalogItemsRequest injectPageSize( + ListCatalogItemsRequest payload, int pageSize) { + return ListCatalogItemsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCatalogItemsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCatalogItemsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCatalogItemsResponse payload) { + return payload.getCatalogItemsList() != null + ? payload.getCatalogItemsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + LIST_CATALOG_ITEMS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCatalogItemsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CATALOG_ITEMS_PAGE_STR_DESC, request, context); + return ListCatalogItemsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for CatalogServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createCatalogItemSettings; + private final UnaryCallSettings.Builder + getCatalogItemSettings; + private final PagedCallSettings.Builder< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + listCatalogItemsSettings; + private final UnaryCallSettings.Builder + updateCatalogItemSettings; + private final UnaryCallSettings.Builder + deleteCatalogItemSettings; + private final UnaryCallSettings.Builder + importCatalogItemsSettings; + private final OperationCallSettings.Builder< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listCatalogItemsSettings = PagedCallSettings.newBuilder(LIST_CATALOG_ITEMS_PAGE_STR_FACT); + + updateCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + importCatalogItemsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + importCatalogItemsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createCatalogItemSettings, + getCatalogItemSettings, + listCatalogItemsSettings, + updateCatalogItemSettings, + deleteCatalogItemSettings, + importCatalogItemsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createCatalogItemSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getCatalogItemSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listCatalogItemsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateCatalogItemSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteCatalogItemSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .importCatalogItemsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .importCatalogItemsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ImportCatalogItemsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(CatalogServiceStubSettings settings) { + super(settings); + + createCatalogItemSettings = settings.createCatalogItemSettings.toBuilder(); + getCatalogItemSettings = settings.getCatalogItemSettings.toBuilder(); + listCatalogItemsSettings = settings.listCatalogItemsSettings.toBuilder(); + updateCatalogItemSettings = settings.updateCatalogItemSettings.toBuilder(); + deleteCatalogItemSettings = settings.deleteCatalogItemSettings.toBuilder(); + importCatalogItemsSettings = settings.importCatalogItemsSettings.toBuilder(); + importCatalogItemsOperationSettings = + settings.importCatalogItemsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createCatalogItemSettings, + getCatalogItemSettings, + listCatalogItemsSettings, + updateCatalogItemSettings, + deleteCatalogItemSettings, + importCatalogItemsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createCatalogItem. */ + public UnaryCallSettings.Builder + createCatalogItemSettings() { + return createCatalogItemSettings; + } + + /** Returns the builder for the settings used for calls to getCatalogItem. */ + public UnaryCallSettings.Builder getCatalogItemSettings() { + return getCatalogItemSettings; + } + + /** Returns the builder for the settings used for calls to listCatalogItems. */ + public PagedCallSettings.Builder< + ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse> + listCatalogItemsSettings() { + return listCatalogItemsSettings; + } + + /** Returns the builder for the settings used for calls to updateCatalogItem. */ + public UnaryCallSettings.Builder + updateCatalogItemSettings() { + return updateCatalogItemSettings; + } + + /** Returns the builder for the settings used for calls to deleteCatalogItem. */ + public UnaryCallSettings.Builder deleteCatalogItemSettings() { + return deleteCatalogItemSettings; + } + + /** Returns the builder for the settings used for calls to importCatalogItems. */ + public UnaryCallSettings.Builder + importCatalogItemsSettings() { + return importCatalogItemsSettings; + } + + /** Returns the builder for the settings used for calls to importCatalogItems. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationSettings() { + return importCatalogItemsOperationSettings; + } + + @Override + public CatalogServiceStubSettings build() throws IOException { + return new CatalogServiceStubSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceCallableFactory.java new file mode 100644 index 00000000..6d65b762 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Recommendations AI. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcCatalogServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java new file mode 100644 index 00000000..2902dd74 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java @@ -0,0 +1,369 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.CatalogServiceClient.ListCatalogItemsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CatalogItem; +import com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse; +import com.google.cloud.recommendationengine.v1beta1.ImportMetadata; +import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse; +import com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcCatalogServiceStub extends CatalogServiceStub { + + private static final MethodDescriptor + createCatalogItemMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.CatalogService/CreateCatalogItem") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateCatalogItemRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CatalogItem.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getCatalogItemMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.CatalogService/GetCatalogItem") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCatalogItemRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CatalogItem.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listCatalogItemsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.CatalogService/ListCatalogItems") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCatalogItemsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCatalogItemsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateCatalogItemMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.CatalogService/UpdateCatalogItem") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCatalogItemRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CatalogItem.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteCatalogItemMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCatalogItemRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + importCatalogItemsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportCatalogItemsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createCatalogItemCallable; + private final UnaryCallable getCatalogItemCallable; + private final UnaryCallable + listCatalogItemsCallable; + private final UnaryCallable + listCatalogItemsPagedCallable; + private final UnaryCallable updateCatalogItemCallable; + private final UnaryCallable deleteCatalogItemCallable; + private final UnaryCallable importCatalogItemsCallable; + private final OperationCallable< + ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata> + importCatalogItemsOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCatalogServiceStub create(CatalogServiceStubSettings settings) + throws IOException { + return new GrpcCatalogServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCatalogServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCatalogServiceStub( + CatalogServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCatalogServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCatalogServiceStub( + CatalogServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCatalogServiceStub, 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 GrpcCatalogServiceStub(CatalogServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCatalogServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCatalogServiceStub, 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 GrpcCatalogServiceStub( + CatalogServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createCatalogItemTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createCatalogItemMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateCatalogItemRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getCatalogItemTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCatalogItemMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetCatalogItemRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listCatalogItemsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCatalogItemsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListCatalogItemsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateCatalogItemTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCatalogItemMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateCatalogItemRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteCatalogItemTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCatalogItemMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteCatalogItemRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings importCatalogItemsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importCatalogItemsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ImportCatalogItemsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.createCatalogItemCallable = + callableFactory.createUnaryCallable( + createCatalogItemTransportSettings, + settings.createCatalogItemSettings(), + clientContext); + this.getCatalogItemCallable = + callableFactory.createUnaryCallable( + getCatalogItemTransportSettings, settings.getCatalogItemSettings(), clientContext); + this.listCatalogItemsCallable = + callableFactory.createUnaryCallable( + listCatalogItemsTransportSettings, settings.listCatalogItemsSettings(), clientContext); + this.listCatalogItemsPagedCallable = + callableFactory.createPagedCallable( + listCatalogItemsTransportSettings, settings.listCatalogItemsSettings(), clientContext); + this.updateCatalogItemCallable = + callableFactory.createUnaryCallable( + updateCatalogItemTransportSettings, + settings.updateCatalogItemSettings(), + clientContext); + this.deleteCatalogItemCallable = + callableFactory.createUnaryCallable( + deleteCatalogItemTransportSettings, + settings.deleteCatalogItemSettings(), + clientContext); + this.importCatalogItemsCallable = + callableFactory.createUnaryCallable( + importCatalogItemsTransportSettings, + settings.importCatalogItemsSettings(), + clientContext); + this.importCatalogItemsOperationCallable = + callableFactory.createOperationCallable( + importCatalogItemsTransportSettings, + settings.importCatalogItemsOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable createCatalogItemCallable() { + return createCatalogItemCallable; + } + + public UnaryCallable getCatalogItemCallable() { + return getCatalogItemCallable; + } + + public UnaryCallable + listCatalogItemsPagedCallable() { + return listCatalogItemsPagedCallable; + } + + public UnaryCallable + listCatalogItemsCallable() { + return listCatalogItemsCallable; + } + + public UnaryCallable updateCatalogItemCallable() { + return updateCatalogItemCallable; + } + + public UnaryCallable deleteCatalogItemCallable() { + return deleteCatalogItemCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + importCatalogItemsOperationCallable() { + return importCatalogItemsOperationCallable; + } + + public UnaryCallable importCatalogItemsCallable() { + return importCatalogItemsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryCallableFactory.java new file mode 100644 index 00000000..68ae5a41 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Recommendations AI. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcPredictionApiKeyRegistryCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java new file mode 100644 index 00000000..fd549a8d --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java @@ -0,0 +1,277 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsPagedResponse; + +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.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest; +import com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest; +import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse; +import com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcPredictionApiKeyRegistryStub extends PredictionApiKeyRegistryStub { + + private static final MethodDescriptor< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/CreatePredictionApiKeyRegistration") + .setRequestMarshaller( + ProtoUtils.marshaller( + CreatePredictionApiKeyRegistrationRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PredictionApiKeyRegistration.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrationsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/ListPredictionApiKeyRegistrations") + .setRequestMarshaller( + ProtoUtils.marshaller( + ListPredictionApiKeyRegistrationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + ListPredictionApiKeyRegistrationsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deletePredictionApiKeyRegistrationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration") + .setRequestMarshaller( + ProtoUtils.marshaller( + DeletePredictionApiKeyRegistrationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationCallable; + private final UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrationsCallable; + private final UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsPagedCallable; + private final UnaryCallable + deletePredictionApiKeyRegistrationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPredictionApiKeyRegistryStub create( + PredictionApiKeyRegistryStubSettings settings) throws IOException { + return new GrpcPredictionApiKeyRegistryStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPredictionApiKeyRegistryStub create(ClientContext clientContext) + throws IOException { + return new GrpcPredictionApiKeyRegistryStub( + PredictionApiKeyRegistryStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPredictionApiKeyRegistryStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPredictionApiKeyRegistryStub( + PredictionApiKeyRegistryStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPredictionApiKeyRegistryStub, 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 GrpcPredictionApiKeyRegistryStub( + PredictionApiKeyRegistryStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcPredictionApiKeyRegistryCallableFactory()); + } + + /** + * Constructs an instance of GrpcPredictionApiKeyRegistryStub, 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 GrpcPredictionApiKeyRegistryStub( + PredictionApiKeyRegistryStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + createPredictionApiKeyRegistrationTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(createPredictionApiKeyRegistrationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + CreatePredictionApiKeyRegistrationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrationsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listPredictionApiKeyRegistrationsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + ListPredictionApiKeyRegistrationsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deletePredictionApiKeyRegistrationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePredictionApiKeyRegistrationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + DeletePredictionApiKeyRegistrationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.createPredictionApiKeyRegistrationCallable = + callableFactory.createUnaryCallable( + createPredictionApiKeyRegistrationTransportSettings, + settings.createPredictionApiKeyRegistrationSettings(), + clientContext); + this.listPredictionApiKeyRegistrationsCallable = + callableFactory.createUnaryCallable( + listPredictionApiKeyRegistrationsTransportSettings, + settings.listPredictionApiKeyRegistrationsSettings(), + clientContext); + this.listPredictionApiKeyRegistrationsPagedCallable = + callableFactory.createPagedCallable( + listPredictionApiKeyRegistrationsTransportSettings, + settings.listPredictionApiKeyRegistrationsSettings(), + clientContext); + this.deletePredictionApiKeyRegistrationCallable = + callableFactory.createUnaryCallable( + deletePredictionApiKeyRegistrationTransportSettings, + settings.deletePredictionApiKeyRegistrationSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable + createPredictionApiKeyRegistrationCallable() { + return createPredictionApiKeyRegistrationCallable; + } + + public UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsPagedCallable() { + return listPredictionApiKeyRegistrationsPagedCallable; + } + + public UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrationsCallable() { + return listPredictionApiKeyRegistrationsCallable; + } + + public UnaryCallable + deletePredictionApiKeyRegistrationCallable() { + return deletePredictionApiKeyRegistrationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionServiceCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionServiceCallableFactory.java new file mode 100644 index 00000000..350df903 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Recommendations AI. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcPredictionServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionServiceStub.java new file mode 100644 index 00000000..f40a0a7b --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionServiceStub.java @@ -0,0 +1,163 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionServiceClient.PredictPagedResponse; + +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.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.PredictRequest; +import com.google.cloud.recommendationengine.v1beta1.PredictResponse; +import com.google.common.collect.ImmutableMap; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcPredictionServiceStub extends PredictionServiceStub { + + private static final MethodDescriptor predictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.recommendationengine.v1beta1.PredictionService/Predict") + .setRequestMarshaller(ProtoUtils.marshaller(PredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PredictResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable predictCallable; + private final UnaryCallable predictPagedCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPredictionServiceStub create(PredictionServiceStubSettings settings) + throws IOException { + return new GrpcPredictionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPredictionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPredictionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcPredictionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings predictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(predictMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PredictRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.predictCallable = + callableFactory.createUnaryCallable( + predictTransportSettings, settings.predictSettings(), clientContext); + this.predictPagedCallable = + callableFactory.createPagedCallable( + predictTransportSettings, settings.predictSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable predictPagedCallable() { + return predictPagedCallable; + } + + public UnaryCallable predictCallable() { + return predictCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceCallableFactory.java new file mode 100644 index 00000000..4bb80e18 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Recommendations AI. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcUserEventServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java new file mode 100644 index 00000000..44e28ed0 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java @@ -0,0 +1,343 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.UserEventServiceClient.ListUserEventsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportMetadata; +import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.UserEvent; +import com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcUserEventServiceStub extends UserEventServiceStub { + + private static final MethodDescriptor + writeUserEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.UserEventService/WriteUserEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(WriteUserEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(UserEvent.getDefaultInstance())) + .build(); + private static final MethodDescriptor + collectUserEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.UserEventService/CollectUserEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(CollectUserEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.UserEventService/ListUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(ListUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListUserEventsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + purgeUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(PurgeUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + importUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable writeUserEventCallable; + private final UnaryCallable collectUserEventCallable; + private final UnaryCallable listUserEventsCallable; + private final UnaryCallable + listUserEventsPagedCallable; + private final UnaryCallable purgeUserEventsCallable; + private final OperationCallable< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationCallable; + private final UnaryCallable importUserEventsCallable; + private final OperationCallable + importUserEventsOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcUserEventServiceStub create(UserEventServiceStubSettings settings) + throws IOException { + return new GrpcUserEventServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcUserEventServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcUserEventServiceStub( + UserEventServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcUserEventServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcUserEventServiceStub( + UserEventServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcUserEventServiceStub, 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 GrpcUserEventServiceStub( + UserEventServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcUserEventServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcUserEventServiceStub, 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 GrpcUserEventServiceStub( + UserEventServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings writeUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeUserEventMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(WriteUserEventRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings collectUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectUserEventMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CollectUserEventRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUserEventsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListUserEventsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings purgeUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeUserEventsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PurgeUserEventsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings importUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importUserEventsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ImportUserEventsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.writeUserEventCallable = + callableFactory.createUnaryCallable( + writeUserEventTransportSettings, settings.writeUserEventSettings(), clientContext); + this.collectUserEventCallable = + callableFactory.createUnaryCallable( + collectUserEventTransportSettings, settings.collectUserEventSettings(), clientContext); + this.listUserEventsCallable = + callableFactory.createUnaryCallable( + listUserEventsTransportSettings, settings.listUserEventsSettings(), clientContext); + this.listUserEventsPagedCallable = + callableFactory.createPagedCallable( + listUserEventsTransportSettings, settings.listUserEventsSettings(), clientContext); + this.purgeUserEventsCallable = + callableFactory.createUnaryCallable( + purgeUserEventsTransportSettings, settings.purgeUserEventsSettings(), clientContext); + this.purgeUserEventsOperationCallable = + callableFactory.createOperationCallable( + purgeUserEventsTransportSettings, + settings.purgeUserEventsOperationSettings(), + clientContext, + this.operationsStub); + this.importUserEventsCallable = + callableFactory.createUnaryCallable( + importUserEventsTransportSettings, settings.importUserEventsSettings(), clientContext); + this.importUserEventsOperationCallable = + callableFactory.createOperationCallable( + importUserEventsTransportSettings, + settings.importUserEventsOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable writeUserEventCallable() { + return writeUserEventCallable; + } + + public UnaryCallable collectUserEventCallable() { + return collectUserEventCallable; + } + + public UnaryCallable + listUserEventsPagedCallable() { + return listUserEventsPagedCallable; + } + + public UnaryCallable listUserEventsCallable() { + return listUserEventsCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + purgeUserEventsOperationCallable() { + return purgeUserEventsOperationCallable; + } + + public UnaryCallable purgeUserEventsCallable() { + return purgeUserEventsCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + importUserEventsOperationCallable() { + return importUserEventsOperationCallable; + } + + public UnaryCallable importUserEventsCallable() { + return importUserEventsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStub.java new file mode 100644 index 00000000..28c95631 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStub.java @@ -0,0 +1,69 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest; +import com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest; +import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse; +import com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class PredictionApiKeyRegistryStub implements BackgroundResource { + + public UnaryCallable + createPredictionApiKeyRegistrationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createPredictionApiKeyRegistrationCallable()"); + } + + public UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listPredictionApiKeyRegistrationsPagedCallable()"); + } + + public UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrationsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listPredictionApiKeyRegistrationsCallable()"); + } + + public UnaryCallable + deletePredictionApiKeyRegistrationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deletePredictionApiKeyRegistrationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStubSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStubSettings.java new file mode 100644 index 00000000..a1c20808 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStubSettings.java @@ -0,0 +1,454 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +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.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest; +import com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest; +import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse; +import com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +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 PredictionApiKeyRegistryStub}. + * + *

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

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

+ * 
+ * PredictionApiKeyRegistryStubSettings.Builder predictionApiKeyRegistrySettingsBuilder =
+ *     PredictionApiKeyRegistryStubSettings.newBuilder();
+ * predictionApiKeyRegistrySettingsBuilder
+ *     .createPredictionApiKeyRegistrationSettings()
+ *     .setRetrySettings(
+ *         predictionApiKeyRegistrySettingsBuilder.createPredictionApiKeyRegistrationSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionApiKeyRegistryStubSettings predictionApiKeyRegistrySettings = predictionApiKeyRegistrySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionApiKeyRegistryStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationSettings; + private final PagedCallSettings< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsSettings; + private final UnaryCallSettings + deletePredictionApiKeyRegistrationSettings; + + /** Returns the object with the settings used for calls to createPredictionApiKeyRegistration. */ + public UnaryCallSettings + createPredictionApiKeyRegistrationSettings() { + return createPredictionApiKeyRegistrationSettings; + } + + /** Returns the object with the settings used for calls to listPredictionApiKeyRegistrations. */ + public PagedCallSettings< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsSettings() { + return listPredictionApiKeyRegistrationsSettings; + } + + /** Returns the object with the settings used for calls to deletePredictionApiKeyRegistration. */ + public UnaryCallSettings + deletePredictionApiKeyRegistrationSettings() { + return deletePredictionApiKeyRegistrationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PredictionApiKeyRegistryStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPredictionApiKeyRegistryStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "recommendationengine.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionApiKeyRegistryStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionApiKeyRegistryStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createPredictionApiKeyRegistrationSettings = + settingsBuilder.createPredictionApiKeyRegistrationSettings().build(); + listPredictionApiKeyRegistrationsSettings = + settingsBuilder.listPredictionApiKeyRegistrationsSettings().build(); + deletePredictionApiKeyRegistrationSettings = + settingsBuilder.deletePredictionApiKeyRegistrationSettings().build(); + } + + private static final PagedListDescriptor< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration> + LIST_PREDICTION_API_KEY_REGISTRATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPredictionApiKeyRegistrationsRequest injectToken( + ListPredictionApiKeyRegistrationsRequest payload, String token) { + return ListPredictionApiKeyRegistrationsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListPredictionApiKeyRegistrationsRequest injectPageSize( + ListPredictionApiKeyRegistrationsRequest payload, int pageSize) { + return ListPredictionApiKeyRegistrationsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListPredictionApiKeyRegistrationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPredictionApiKeyRegistrationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListPredictionApiKeyRegistrationsResponse payload) { + return payload.getPredictionApiKeyRegistrationsList() != null + ? payload.getPredictionApiKeyRegistrationsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + LIST_PREDICTION_API_KEY_REGISTRATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse> + callable, + ListPredictionApiKeyRegistrationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + PredictionApiKeyRegistration> + pageContext = + PageContext.create( + callable, + LIST_PREDICTION_API_KEY_REGISTRATIONS_PAGE_STR_DESC, + request, + context); + return ListPredictionApiKeyRegistrationsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Builder for PredictionApiKeyRegistryStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationSettings; + private final PagedCallSettings.Builder< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsSettings; + private final UnaryCallSettings.Builder + deletePredictionApiKeyRegistrationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createPredictionApiKeyRegistrationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listPredictionApiKeyRegistrationsSettings = + PagedCallSettings.newBuilder(LIST_PREDICTION_API_KEY_REGISTRATIONS_PAGE_STR_FACT); + + deletePredictionApiKeyRegistrationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPredictionApiKeyRegistrationSettings, + listPredictionApiKeyRegistrationsSettings, + deletePredictionApiKeyRegistrationSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createPredictionApiKeyRegistrationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listPredictionApiKeyRegistrationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deletePredictionApiKeyRegistrationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(PredictionApiKeyRegistryStubSettings settings) { + super(settings); + + createPredictionApiKeyRegistrationSettings = + settings.createPredictionApiKeyRegistrationSettings.toBuilder(); + listPredictionApiKeyRegistrationsSettings = + settings.listPredictionApiKeyRegistrationsSettings.toBuilder(); + deletePredictionApiKeyRegistrationSettings = + settings.deletePredictionApiKeyRegistrationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPredictionApiKeyRegistrationSettings, + listPredictionApiKeyRegistrationsSettings, + deletePredictionApiKeyRegistrationSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to createPredictionApiKeyRegistration. + */ + public UnaryCallSettings.Builder< + CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration> + createPredictionApiKeyRegistrationSettings() { + return createPredictionApiKeyRegistrationSettings; + } + + /** Returns the builder for the settings used for calls to listPredictionApiKeyRegistrations. */ + public PagedCallSettings.Builder< + ListPredictionApiKeyRegistrationsRequest, + ListPredictionApiKeyRegistrationsResponse, + ListPredictionApiKeyRegistrationsPagedResponse> + listPredictionApiKeyRegistrationsSettings() { + return listPredictionApiKeyRegistrationsSettings; + } + + /** + * Returns the builder for the settings used for calls to deletePredictionApiKeyRegistration. + */ + public UnaryCallSettings.Builder + deletePredictionApiKeyRegistrationSettings() { + return deletePredictionApiKeyRegistrationSettings; + } + + @Override + public PredictionApiKeyRegistryStubSettings build() throws IOException { + return new PredictionApiKeyRegistryStubSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStub.java new file mode 100644 index 00000000..5167d29e --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStub.java @@ -0,0 +1,47 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionServiceClient.PredictPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.PredictRequest; +import com.google.cloud.recommendationengine.v1beta1.PredictResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class PredictionServiceStub implements BackgroundResource { + + public UnaryCallable predictPagedCallable() { + throw new UnsupportedOperationException("Not implemented: predictPagedCallable()"); + } + + public UnaryCallable predictCallable() { + throw new UnsupportedOperationException("Not implemented: predictCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStubSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStubSettings.java new file mode 100644 index 00000000..da4e3964 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStubSettings.java @@ -0,0 +1,340 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionServiceClient.PredictPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +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.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.PredictRequest; +import com.google.cloud.recommendationengine.v1beta1.PredictResponse; +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 PredictionServiceStub}. + * + *

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

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

+ * 
+ * PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceStubSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder.predictSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceStubSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PredictionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings + predictSettings; + + /** Returns the object with the settings used for calls to predict. */ + public PagedCallSettings + predictSettings() { + return predictSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PredictionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPredictionServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "recommendationengine.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + predictSettings = settingsBuilder.predictSettings().build(); + } + + private static final PagedListDescriptor< + PredictRequest, PredictResponse, PredictResponse.PredictionResult> + PREDICT_PAGE_STR_DESC = + new PagedListDescriptor< + PredictRequest, PredictResponse, PredictResponse.PredictionResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PredictRequest injectToken(PredictRequest payload, String token) { + return PredictRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PredictRequest injectPageSize(PredictRequest payload, int pageSize) { + return PredictRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PredictRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PredictResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + PredictResponse payload) { + return payload.getResultsList() != null + ? payload.getResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + PredictRequest, PredictResponse, PredictPagedResponse> + PREDICT_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PredictRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create(callable, PREDICT_PAGE_STR_DESC, request, context); + return PredictPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for PredictionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder + predictSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + predictSettings = PagedCallSettings.newBuilder(PREDICT_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .predictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(PredictionServiceStubSettings settings) { + super(settings); + + predictSettings = settings.predictSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to predict. */ + public PagedCallSettings.Builder + predictSettings() { + return predictSettings; + } + + @Override + public PredictionServiceStubSettings build() throws IOException { + return new PredictionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStub.java new file mode 100644 index 00000000..00256084 --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStub.java @@ -0,0 +1,94 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.UserEventServiceClient.ListUserEventsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportMetadata; +import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.UserEvent; +import com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Recommendations AI. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class UserEventServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable writeUserEventCallable() { + throw new UnsupportedOperationException("Not implemented: writeUserEventCallable()"); + } + + public UnaryCallable collectUserEventCallable() { + throw new UnsupportedOperationException("Not implemented: collectUserEventCallable()"); + } + + public UnaryCallable + listUserEventsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUserEventsPagedCallable()"); + } + + public UnaryCallable listUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: listUserEventsCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + purgeUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: purgeUserEventsOperationCallable()"); + } + + public UnaryCallable purgeUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: purgeUserEventsCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + importUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsOperationCallable()"); + } + + public UnaryCallable importUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStubSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStubSettings.java new file mode 100644 index 00000000..b89666ae --- /dev/null +++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStubSettings.java @@ -0,0 +1,555 @@ +/* + * 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.recommendationengine.v1beta1.stub; + +import static com.google.cloud.recommendationengine.v1beta1.UserEventServiceClient.ListUserEventsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +import com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportMetadata; +import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest; +import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse; +import com.google.cloud.recommendationengine.v1beta1.UserEvent; +import com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link UserEventServiceStub}. + * + *

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

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

+ * 
+ * UserEventServiceStubSettings.Builder userEventServiceSettingsBuilder =
+ *     UserEventServiceStubSettings.newBuilder();
+ * userEventServiceSettingsBuilder
+ *     .writeUserEventSettings()
+ *     .setRetrySettings(
+ *         userEventServiceSettingsBuilder.writeUserEventSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * UserEventServiceStubSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class UserEventServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings writeUserEventSettings; + private final UnaryCallSettings collectUserEventSettings; + private final PagedCallSettings< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + listUserEventsSettings; + private final UnaryCallSettings purgeUserEventsSettings; + private final OperationCallSettings< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings importUserEventsSettings; + private final OperationCallSettings< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings; + + /** Returns the object with the settings used for calls to writeUserEvent. */ + public UnaryCallSettings writeUserEventSettings() { + return writeUserEventSettings; + } + + /** Returns the object with the settings used for calls to collectUserEvent. */ + public UnaryCallSettings collectUserEventSettings() { + return collectUserEventSettings; + } + + /** Returns the object with the settings used for calls to listUserEvents. */ + public PagedCallSettings< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + listUserEventsSettings() { + return listUserEventsSettings; + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings purgeUserEventsSettings() { + return purgeUserEventsSettings; + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings() { + return purgeUserEventsOperationSettings; + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public UnaryCallSettings importUserEventsSettings() { + return importUserEventsSettings; + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public UserEventServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcUserEventServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "recommendationengine.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(UserEventServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected UserEventServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + writeUserEventSettings = settingsBuilder.writeUserEventSettings().build(); + collectUserEventSettings = settingsBuilder.collectUserEventSettings().build(); + listUserEventsSettings = settingsBuilder.listUserEventsSettings().build(); + purgeUserEventsSettings = settingsBuilder.purgeUserEventsSettings().build(); + purgeUserEventsOperationSettings = settingsBuilder.purgeUserEventsOperationSettings().build(); + importUserEventsSettings = settingsBuilder.importUserEventsSettings().build(); + importUserEventsOperationSettings = settingsBuilder.importUserEventsOperationSettings().build(); + } + + private static final PagedListDescriptor + LIST_USER_EVENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUserEventsRequest injectToken(ListUserEventsRequest payload, String token) { + return ListUserEventsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUserEventsRequest injectPageSize( + ListUserEventsRequest payload, int pageSize) { + return ListUserEventsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUserEventsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUserEventsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUserEventsResponse payload) { + return payload.getUserEventsList() != null + ? payload.getUserEventsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + LIST_USER_EVENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUserEventsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USER_EVENTS_PAGE_STR_DESC, request, context); + return ListUserEventsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for UserEventServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + writeUserEventSettings; + private final UnaryCallSettings.Builder + collectUserEventSettings; + private final PagedCallSettings.Builder< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + listUserEventsSettings; + private final UnaryCallSettings.Builder + purgeUserEventsSettings; + private final OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings.Builder + importUserEventsSettings; + private final OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + writeUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + collectUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listUserEventsSettings = PagedCallSettings.newBuilder(LIST_USER_EVENTS_PAGE_STR_FACT); + + purgeUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + purgeUserEventsOperationSettings = OperationCallSettings.newBuilder(); + + importUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + importUserEventsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + listUserEventsSettings, + purgeUserEventsSettings, + importUserEventsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .writeUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .collectUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .purgeUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .importUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .purgeUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(PurgeUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PurgeUserEventsMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .importUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ImportUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(UserEventServiceStubSettings settings) { + super(settings); + + writeUserEventSettings = settings.writeUserEventSettings.toBuilder(); + collectUserEventSettings = settings.collectUserEventSettings.toBuilder(); + listUserEventsSettings = settings.listUserEventsSettings.toBuilder(); + purgeUserEventsSettings = settings.purgeUserEventsSettings.toBuilder(); + purgeUserEventsOperationSettings = settings.purgeUserEventsOperationSettings.toBuilder(); + importUserEventsSettings = settings.importUserEventsSettings.toBuilder(); + importUserEventsOperationSettings = settings.importUserEventsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + listUserEventsSettings, + purgeUserEventsSettings, + importUserEventsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to writeUserEvent. */ + public UnaryCallSettings.Builder writeUserEventSettings() { + return writeUserEventSettings; + } + + /** Returns the builder for the settings used for calls to collectUserEvent. */ + public UnaryCallSettings.Builder collectUserEventSettings() { + return collectUserEventSettings; + } + + /** Returns the builder for the settings used for calls to listUserEvents. */ + public PagedCallSettings.Builder< + ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse> + listUserEventsSettings() { + return listUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings.Builder purgeUserEventsSettings() { + return purgeUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings() { + return purgeUserEventsOperationSettings; + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public UnaryCallSettings.Builder + importUserEventsSettings() { + return importUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + @Override + public UserEventServiceStubSettings build() throws IOException { + return new UserEventServiceStubSettings(this); + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClientTest.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClientTest.java new file mode 100644 index 00000000..496cad7f --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClientTest.java @@ -0,0 +1,414 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.CatalogServiceClient.ListCatalogItemsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class CatalogServiceClientTest { + private static MockCatalogService mockCatalogService; + private static MockPredictionApiKeyRegistry mockPredictionApiKeyRegistry; + private static MockPredictionService mockPredictionService; + private static MockUserEventService mockUserEventService; + private static MockServiceHelper serviceHelper; + private CatalogServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCatalogService = new MockCatalogService(); + mockPredictionApiKeyRegistry = new MockPredictionApiKeyRegistry(); + mockPredictionService = new MockPredictionService(); + mockUserEventService = new MockUserEventService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockCatalogService, + mockPredictionApiKeyRegistry, + mockPredictionService, + mockUserEventService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + CatalogServiceSettings settings = + CatalogServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CatalogServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createCatalogItemTest() { + String id = "id3355"; + String title = "title110371416"; + String description = "description-1724546052"; + String languageCode = "languageCode-412800396"; + String itemGroupId = "itemGroupId894431879"; + CatalogItem expectedResponse = + CatalogItem.newBuilder() + .setId(id) + .setTitle(title) + .setDescription(description) + .setLanguageCode(languageCode) + .setItemGroupId(itemGroupId) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String formattedParent = + CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]"); + CatalogItem catalogItem = CatalogItem.newBuilder().build(); + + CatalogItem actualResponse = client.createCatalogItem(formattedParent, catalogItem); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCatalogItemRequest actualRequest = (CreateCatalogItemRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(catalogItem, actualRequest.getCatalogItem()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createCatalogItemExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String formattedParent = + CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]"); + CatalogItem catalogItem = CatalogItem.newBuilder().build(); + + client.createCatalogItem(formattedParent, catalogItem); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getCatalogItemTest() { + String id = "id3355"; + String title = "title110371416"; + String description = "description-1724546052"; + String languageCode = "languageCode-412800396"; + String itemGroupId = "itemGroupId894431879"; + CatalogItem expectedResponse = + CatalogItem.newBuilder() + .setId(id) + .setTitle(title) + .setDescription(description) + .setLanguageCode(languageCode) + .setItemGroupId(itemGroupId) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String formattedName = + CatalogServiceClient.formatCatalogItemPathName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]"); + + CatalogItem actualResponse = client.getCatalogItem(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCatalogItemRequest actualRequest = (GetCatalogItemRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getCatalogItemExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String formattedName = + CatalogServiceClient.formatCatalogItemPathName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]"); + + client.getCatalogItem(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listCatalogItemsTest() { + String nextPageToken = ""; + CatalogItem catalogItemsElement = CatalogItem.newBuilder().build(); + List catalogItems = Arrays.asList(catalogItemsElement); + ListCatalogItemsResponse expectedResponse = + ListCatalogItemsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllCatalogItems(catalogItems) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String formattedParent = + CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]"); + String filter = "filter-1274492040"; + + ListCatalogItemsPagedResponse pagedListResponse = + client.listCatalogItems(formattedParent, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCatalogItemsList().get(0), resources.get(0)); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCatalogItemsRequest actualRequest = (ListCatalogItemsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listCatalogItemsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String formattedParent = + CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]"); + String filter = "filter-1274492040"; + + client.listCatalogItems(formattedParent, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateCatalogItemTest() { + String id = "id3355"; + String title = "title110371416"; + String description = "description-1724546052"; + String languageCode = "languageCode-412800396"; + String itemGroupId = "itemGroupId894431879"; + CatalogItem expectedResponse = + CatalogItem.newBuilder() + .setId(id) + .setTitle(title) + .setDescription(description) + .setLanguageCode(languageCode) + .setItemGroupId(itemGroupId) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String formattedName = + CatalogServiceClient.formatCatalogItemPathName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]"); + CatalogItem catalogItem = CatalogItem.newBuilder().build(); + + CatalogItem actualResponse = client.updateCatalogItem(formattedName, catalogItem); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCatalogItemRequest actualRequest = (UpdateCatalogItemRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(catalogItem, actualRequest.getCatalogItem()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateCatalogItemExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String formattedName = + CatalogServiceClient.formatCatalogItemPathName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]"); + CatalogItem catalogItem = CatalogItem.newBuilder().build(); + + client.updateCatalogItem(formattedName, catalogItem); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteCatalogItemTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + String formattedName = + CatalogServiceClient.formatCatalogItemPathName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]"); + + client.deleteCatalogItem(formattedName); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCatalogItemRequest actualRequest = (DeleteCatalogItemRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteCatalogItemExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String formattedName = + CatalogServiceClient.formatCatalogItemPathName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]"); + + client.deleteCatalogItem(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void importCatalogItemsTest() throws Exception { + ImportCatalogItemsResponse expectedResponse = ImportCatalogItemsResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importCatalogItemsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCatalogService.addResponse(resultOperation); + + String formattedParent = + CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]"); + String requestId = "requestId37109963"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build(); + + ImportCatalogItemsResponse actualResponse = + client.importCatalogItemsAsync(formattedParent, requestId, inputConfig, errorsConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportCatalogItemsRequest actualRequest = (ImportCatalogItemsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(requestId, actualRequest.getRequestId()); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); + Assert.assertEquals(errorsConfig, actualRequest.getErrorsConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void importCatalogItemsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String formattedParent = + CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]"); + String requestId = "requestId37109963"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build(); + + client.importCatalogItemsAsync(formattedParent, requestId, inputConfig, errorsConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockCatalogService.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockCatalogService.java new file mode 100644 index 00000000..6d5bd50f --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockCatalogService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCatalogService implements MockGrpcService { + private final MockCatalogServiceImpl serviceImpl; + + public MockCatalogService() { + serviceImpl = new MockCatalogServiceImpl(); + } + + @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-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockCatalogServiceImpl.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockCatalogServiceImpl.java new file mode 100644 index 00000000..aef084fd --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockCatalogServiceImpl.java @@ -0,0 +1,150 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.recommendationengine.v1beta1.CatalogServiceGrpc.CatalogServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCatalogServiceImpl extends CatalogServiceImplBase { + private List requests; + private Queue responses; + + public MockCatalogServiceImpl() { + 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 createCatalogItem( + CreateCatalogItemRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CatalogItem) { + requests.add(request); + responseObserver.onNext((CatalogItem) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getCatalogItem( + GetCatalogItemRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CatalogItem) { + requests.add(request); + responseObserver.onNext((CatalogItem) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listCatalogItems( + ListCatalogItemsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListCatalogItemsResponse) { + requests.add(request); + responseObserver.onNext((ListCatalogItemsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateCatalogItem( + UpdateCatalogItemRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CatalogItem) { + requests.add(request); + responseObserver.onNext((CatalogItem) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteCatalogItem( + DeleteCatalogItemRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void importCatalogItems( + ImportCatalogItemsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionApiKeyRegistry.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionApiKeyRegistry.java new file mode 100644 index 00000000..585305a7 --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionApiKeyRegistry.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockPredictionApiKeyRegistry implements MockGrpcService { + private final MockPredictionApiKeyRegistryImpl serviceImpl; + + public MockPredictionApiKeyRegistry() { + serviceImpl = new MockPredictionApiKeyRegistryImpl(); + } + + @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-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionApiKeyRegistryImpl.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionApiKeyRegistryImpl.java new file mode 100644 index 00000000..d18d116a --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionApiKeyRegistryImpl.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. + */ +package com.google.cloud.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryGrpc.PredictionApiKeyRegistryImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockPredictionApiKeyRegistryImpl extends PredictionApiKeyRegistryImplBase { + private List requests; + private Queue responses; + + public MockPredictionApiKeyRegistryImpl() { + 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 createPredictionApiKeyRegistration( + CreatePredictionApiKeyRegistrationRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PredictionApiKeyRegistration) { + requests.add(request); + responseObserver.onNext((PredictionApiKeyRegistration) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listPredictionApiKeyRegistrations( + ListPredictionApiKeyRegistrationsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListPredictionApiKeyRegistrationsResponse) { + requests.add(request); + responseObserver.onNext((ListPredictionApiKeyRegistrationsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deletePredictionApiKeyRegistration( + DeletePredictionApiKeyRegistrationRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionService.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionService.java new file mode 100644 index 00000000..6a8b6f08 --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockPredictionService implements MockGrpcService { + private final MockPredictionServiceImpl serviceImpl; + + public MockPredictionService() { + serviceImpl = new MockPredictionServiceImpl(); + } + + @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-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionServiceImpl.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionServiceImpl.java new file mode 100644 index 00000000..8dae842f --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockPredictionServiceImpl.java @@ -0,0 +1,72 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.recommendationengine.v1beta1.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockPredictionServiceImpl extends PredictionServiceImplBase { + private List requests; + private Queue responses; + + public MockPredictionServiceImpl() { + 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 predict(PredictRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PredictResponse) { + requests.add(request); + responseObserver.onNext((PredictResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockUserEventService.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockUserEventService.java new file mode 100644 index 00000000..a19c8292 --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockUserEventService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockUserEventService implements MockGrpcService { + private final MockUserEventServiceImpl serviceImpl; + + public MockUserEventService() { + serviceImpl = new MockUserEventServiceImpl(); + } + + @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-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockUserEventServiceImpl.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockUserEventServiceImpl.java new file mode 100644 index 00000000..cb47b242 --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/MockUserEventServiceImpl.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recommendationengine.v1beta1; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.cloud.recommendationengine.v1beta1.UserEventServiceGrpc.UserEventServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockUserEventServiceImpl extends UserEventServiceImplBase { + private List requests; + private Queue responses; + + public MockUserEventServiceImpl() { + 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 writeUserEvent( + WriteUserEventRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof UserEvent) { + requests.add(request); + responseObserver.onNext((UserEvent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void collectUserEvent( + CollectUserEventRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof HttpBody) { + requests.add(request); + responseObserver.onNext((HttpBody) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listUserEvents( + ListUserEventsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListUserEventsResponse) { + requests.add(request); + responseObserver.onNext((ListUserEventsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void purgeUserEvents( + PurgeUserEventsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void importUserEvents( + ImportUserEventsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClientTest.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClientTest.java new file mode 100644 index 00000000..1869b5b1 --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClientTest.java @@ -0,0 +1,251 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class PredictionApiKeyRegistryClientTest { + private static MockCatalogService mockCatalogService; + private static MockPredictionApiKeyRegistry mockPredictionApiKeyRegistry; + private static MockPredictionService mockPredictionService; + private static MockUserEventService mockUserEventService; + private static MockServiceHelper serviceHelper; + private PredictionApiKeyRegistryClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCatalogService = new MockCatalogService(); + mockPredictionApiKeyRegistry = new MockPredictionApiKeyRegistry(); + mockPredictionService = new MockPredictionService(); + mockUserEventService = new MockUserEventService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockCatalogService, + mockPredictionApiKeyRegistry, + mockPredictionService, + mockUserEventService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + PredictionApiKeyRegistrySettings settings = + PredictionApiKeyRegistrySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionApiKeyRegistryClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createPredictionApiKeyRegistrationTest() { + String apiKey = "apiKey-800085318"; + PredictionApiKeyRegistration expectedResponse = + PredictionApiKeyRegistration.newBuilder().setApiKey(apiKey).build(); + mockPredictionApiKeyRegistry.addResponse(expectedResponse); + + String formattedParent = + PredictionApiKeyRegistryClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + PredictionApiKeyRegistration predictionApiKeyRegistration = + PredictionApiKeyRegistration.newBuilder().build(); + + PredictionApiKeyRegistration actualResponse = + client.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionApiKeyRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePredictionApiKeyRegistrationRequest actualRequest = + (CreatePredictionApiKeyRegistrationRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals( + predictionApiKeyRegistration, actualRequest.getPredictionApiKeyRegistration()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createPredictionApiKeyRegistrationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPredictionApiKeyRegistry.addException(exception); + + try { + String formattedParent = + PredictionApiKeyRegistryClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + PredictionApiKeyRegistration predictionApiKeyRegistration = + PredictionApiKeyRegistration.newBuilder().build(); + + client.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listPredictionApiKeyRegistrationsTest() { + String nextPageToken = ""; + PredictionApiKeyRegistration predictionApiKeyRegistrationsElement = + PredictionApiKeyRegistration.newBuilder().build(); + List predictionApiKeyRegistrations = + Arrays.asList(predictionApiKeyRegistrationsElement); + ListPredictionApiKeyRegistrationsResponse expectedResponse = + ListPredictionApiKeyRegistrationsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPredictionApiKeyRegistrations(predictionApiKeyRegistrations) + .build(); + mockPredictionApiKeyRegistry.addResponse(expectedResponse); + + String formattedParent = + PredictionApiKeyRegistryClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + + ListPredictionApiKeyRegistrationsPagedResponse pagedListResponse = + client.listPredictionApiKeyRegistrations(formattedParent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getPredictionApiKeyRegistrationsList().get(0), resources.get(0)); + + List actualRequests = mockPredictionApiKeyRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPredictionApiKeyRegistrationsRequest actualRequest = + (ListPredictionApiKeyRegistrationsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listPredictionApiKeyRegistrationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPredictionApiKeyRegistry.addException(exception); + + try { + String formattedParent = + PredictionApiKeyRegistryClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + + client.listPredictionApiKeyRegistrations(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deletePredictionApiKeyRegistrationTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockPredictionApiKeyRegistry.addResponse(expectedResponse); + + String formattedName = + PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName( + "[PROJECT]", + "[LOCATION]", + "[CATALOG]", + "[EVENT_STORE]", + "[PREDICTION_API_KEY_REGISTRATION]"); + + client.deletePredictionApiKeyRegistration(formattedName); + + List actualRequests = mockPredictionApiKeyRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePredictionApiKeyRegistrationRequest actualRequest = + (DeletePredictionApiKeyRegistrationRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deletePredictionApiKeyRegistrationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPredictionApiKeyRegistry.addException(exception); + + try { + String formattedName = + PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName( + "[PROJECT]", + "[LOCATION]", + "[CATALOG]", + "[EVENT_STORE]", + "[PREDICTION_API_KEY_REGISTRATION]"); + + client.deletePredictionApiKeyRegistration(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClientTest.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClientTest.java new file mode 100644 index 00000000..a75fe5cf --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClientTest.java @@ -0,0 +1,155 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.PredictionServiceClient.PredictPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class PredictionServiceClientTest { + private static MockCatalogService mockCatalogService; + private static MockPredictionApiKeyRegistry mockPredictionApiKeyRegistry; + private static MockPredictionService mockPredictionService; + private static MockUserEventService mockUserEventService; + private static MockServiceHelper serviceHelper; + private PredictionServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCatalogService = new MockCatalogService(); + mockPredictionApiKeyRegistry = new MockPredictionApiKeyRegistry(); + mockPredictionService = new MockPredictionService(); + mockUserEventService = new MockUserEventService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockCatalogService, + mockPredictionApiKeyRegistry, + mockPredictionService, + mockUserEventService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + PredictionServiceSettings settings = + PredictionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void predictTest() { + String recommendationToken = "recommendationToken-1973883405"; + boolean dryRun = false; + String nextPageToken = ""; + PredictResponse.PredictionResult resultsElement = + PredictResponse.PredictionResult.newBuilder().build(); + List results = Arrays.asList(resultsElement); + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .setRecommendationToken(recommendationToken) + .setDryRun(dryRun) + .setNextPageToken(nextPageToken) + .addAllResults(results) + .build(); + mockPredictionService.addResponse(expectedResponse); + + String formattedName = + PredictionServiceClient.formatPlacementName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]"); + UserEvent userEvent = UserEvent.newBuilder().build(); + PredictRequest request = + PredictRequest.newBuilder().setName(formattedName).setUserEvent(userEvent).build(); + + PredictPagedResponse pagedListResponse = client.predict(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PredictRequest actualRequest = (PredictRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(userEvent, actualRequest.getUserEvent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void predictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + String formattedName = + PredictionServiceClient.formatPlacementName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]"); + UserEvent userEvent = UserEvent.newBuilder().build(); + PredictRequest request = + PredictRequest.newBuilder().setName(formattedName).setUserEvent(userEvent).build(); + + client.predict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClientTest.java b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClientTest.java new file mode 100644 index 00000000..187f993c --- /dev/null +++ b/google-cloud-recommendations-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClientTest.java @@ -0,0 +1,370 @@ +/* + * 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.recommendationengine.v1beta1; + +import static com.google.cloud.recommendationengine.v1beta1.UserEventServiceClient.ListUserEventsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class UserEventServiceClientTest { + private static MockCatalogService mockCatalogService; + private static MockPredictionApiKeyRegistry mockPredictionApiKeyRegistry; + private static MockPredictionService mockPredictionService; + private static MockUserEventService mockUserEventService; + private static MockServiceHelper serviceHelper; + private UserEventServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCatalogService = new MockCatalogService(); + mockPredictionApiKeyRegistry = new MockPredictionApiKeyRegistry(); + mockPredictionService = new MockPredictionService(); + mockUserEventService = new MockUserEventService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockCatalogService, + mockPredictionApiKeyRegistry, + mockPredictionService, + mockUserEventService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + UserEventServiceSettings settings = + UserEventServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = UserEventServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void writeUserEventTest() { + String eventType = "eventType984376767"; + UserEvent expectedResponse = UserEvent.newBuilder().setEventType(eventType).build(); + mockUserEventService.addResponse(expectedResponse); + + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + UserEvent userEvent = UserEvent.newBuilder().build(); + + UserEvent actualResponse = client.writeUserEvent(formattedParent, userEvent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteUserEventRequest actualRequest = (WriteUserEventRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(userEvent, actualRequest.getUserEvent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void writeUserEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + UserEvent userEvent = UserEvent.newBuilder().build(); + + client.writeUserEvent(formattedParent, userEvent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void collectUserEventTest() { + String contentType = "contentType831846208"; + ByteString data = ByteString.copyFromUtf8("-86"); + HttpBody expectedResponse = + HttpBody.newBuilder().setContentType(contentType).setData(data).build(); + mockUserEventService.addResponse(expectedResponse); + + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String userEvent = "userEvent1921940774"; + String uri = "uri116076"; + long ets = 100772L; + + HttpBody actualResponse = client.collectUserEvent(formattedParent, userEvent, uri, ets); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CollectUserEventRequest actualRequest = (CollectUserEventRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(userEvent, actualRequest.getUserEvent()); + Assert.assertEquals(uri, actualRequest.getUri()); + Assert.assertEquals(ets, actualRequest.getEts()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void collectUserEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String userEvent = "userEvent1921940774"; + String uri = "uri116076"; + long ets = 100772L; + + client.collectUserEvent(formattedParent, userEvent, uri, ets); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listUserEventsTest() { + String nextPageToken = ""; + UserEvent userEventsElement = UserEvent.newBuilder().build(); + List userEvents = Arrays.asList(userEventsElement); + ListUserEventsResponse expectedResponse = + ListUserEventsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllUserEvents(userEvents) + .build(); + mockUserEventService.addResponse(expectedResponse); + + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String filter = "filter-1274492040"; + + ListUserEventsPagedResponse pagedListResponse = client.listUserEvents(formattedParent, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUserEventsList().get(0), resources.get(0)); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUserEventsRequest actualRequest = (ListUserEventsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String filter = "filter-1274492040"; + + client.listUserEvents(formattedParent, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void purgeUserEventsTest() throws Exception { + long purgedEventsCount = 310774833L; + PurgeUserEventsResponse expectedResponse = + PurgeUserEventsResponse.newBuilder().setPurgedEventsCount(purgedEventsCount).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String filter = "filter-1274492040"; + boolean force = false; + + PurgeUserEventsResponse actualResponse = + client.purgeUserEventsAsync(formattedParent, filter, force).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PurgeUserEventsRequest actualRequest = (PurgeUserEventsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(force, actualRequest.getForce()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void purgeUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String filter = "filter-1274492040"; + boolean force = false; + + client.purgeUserEventsAsync(formattedParent, filter, force).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void importUserEventsTest() throws Exception { + ImportUserEventsResponse expectedResponse = ImportUserEventsResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String requestId = "requestId37109963"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build(); + + ImportUserEventsResponse actualResponse = + client.importUserEventsAsync(formattedParent, requestId, inputConfig, errorsConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportUserEventsRequest actualRequest = (ImportUserEventsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(requestId, actualRequest.getRequestId()); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); + Assert.assertEquals(errorsConfig, actualRequest.getErrorsConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void importUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + String formattedParent = + UserEventServiceClient.formatEventStoreName( + "[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]"); + String requestId = "requestId37109963"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build(); + + client.importUserEventsAsync(formattedParent, requestId, inputConfig, errorsConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/grpc-google-cloud-recommendations-ai-v1beta1/pom.xml b/grpc-google-cloud-recommendations-ai-v1beta1/pom.xml new file mode 100644 index 00000000..2c7349a2 --- /dev/null +++ b/grpc-google-cloud-recommendations-ai-v1beta1/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-recommendations-ai-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-recommendations-ai-v1beta1 + GRPC library for grpc-google-cloud-recommendations-ai-v1beta1 + + com.google.cloud + google-cloud-recommendations-ai-parent + 0.0.1-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-recommendations-ai-v1beta1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-common-protos + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceGrpc.java b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceGrpc.java new file mode 100644 index 00000000..f9f7883e --- /dev/null +++ b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceGrpc.java @@ -0,0 +1,987 @@ +/* + * 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.recommendationengine.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service for ingesting catalog information of the customer's website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/recommendationengine/v1beta1/catalog_service.proto") +public final class CatalogServiceGrpc { + + private CatalogServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.recommendationengine.v1beta1.CatalogService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getCreateCatalogItemMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCatalogItem", + requestType = com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.CatalogItem.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getCreateCatalogItemMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getCreateCatalogItemMethod; + if ((getCreateCatalogItemMethod = CatalogServiceGrpc.getCreateCatalogItemMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getCreateCatalogItemMethod = CatalogServiceGrpc.getCreateCatalogItemMethod) == null) { + CatalogServiceGrpc.getCreateCatalogItemMethod = + getCreateCatalogItemMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCatalogItem")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("CreateCatalogItem")) + .build(); + } + } + } + return getCreateCatalogItemMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getGetCatalogItemMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCatalogItem", + requestType = com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.CatalogItem.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getGetCatalogItemMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getGetCatalogItemMethod; + if ((getGetCatalogItemMethod = CatalogServiceGrpc.getGetCatalogItemMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetCatalogItemMethod = CatalogServiceGrpc.getGetCatalogItemMethod) == null) { + CatalogServiceGrpc.getGetCatalogItemMethod = + getGetCatalogItemMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCatalogItem")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetCatalogItem")) + .build(); + } + } + } + return getGetCatalogItemMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse> + getListCatalogItemsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCatalogItems", + requestType = com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse> + getListCatalogItemsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse> + getListCatalogItemsMethod; + if ((getListCatalogItemsMethod = CatalogServiceGrpc.getListCatalogItemsMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getListCatalogItemsMethod = CatalogServiceGrpc.getListCatalogItemsMethod) == null) { + CatalogServiceGrpc.getListCatalogItemsMethod = + getListCatalogItemsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCatalogItems")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("ListCatalogItems")) + .build(); + } + } + } + return getListCatalogItemsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getUpdateCatalogItemMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCatalogItem", + requestType = com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.CatalogItem.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getUpdateCatalogItemMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getUpdateCatalogItemMethod; + if ((getUpdateCatalogItemMethod = CatalogServiceGrpc.getUpdateCatalogItemMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateCatalogItemMethod = CatalogServiceGrpc.getUpdateCatalogItemMethod) == null) { + CatalogServiceGrpc.getUpdateCatalogItemMethod = + getUpdateCatalogItemMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCatalogItem")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateCatalogItem")) + .build(); + } + } + } + return getUpdateCatalogItemMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest, + com.google.protobuf.Empty> + getDeleteCatalogItemMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCatalogItem", + requestType = com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest, + com.google.protobuf.Empty> + getDeleteCatalogItemMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest, + com.google.protobuf.Empty> + getDeleteCatalogItemMethod; + if ((getDeleteCatalogItemMethod = CatalogServiceGrpc.getDeleteCatalogItemMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getDeleteCatalogItemMethod = CatalogServiceGrpc.getDeleteCatalogItemMethod) == null) { + CatalogServiceGrpc.getDeleteCatalogItemMethod = + getDeleteCatalogItemMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCatalogItem")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("DeleteCatalogItem")) + .build(); + } + } + } + return getDeleteCatalogItemMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest, + com.google.longrunning.Operation> + getImportCatalogItemsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportCatalogItems", + requestType = com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest, + com.google.longrunning.Operation> + getImportCatalogItemsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest, + com.google.longrunning.Operation> + getImportCatalogItemsMethod; + if ((getImportCatalogItemsMethod = CatalogServiceGrpc.getImportCatalogItemsMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getImportCatalogItemsMethod = CatalogServiceGrpc.getImportCatalogItemsMethod) + == null) { + CatalogServiceGrpc.getImportCatalogItemsMethod = + getImportCatalogItemsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportCatalogItems")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1 + .ImportCatalogItemsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("ImportCatalogItems")) + .build(); + } + } + } + return getImportCatalogItemsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CatalogServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceStub(channel, callOptions); + } + }; + return CatalogServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CatalogServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceBlockingStub(channel, callOptions); + } + }; + return CatalogServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CatalogServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceFutureStub(channel, callOptions); + } + }; + return CatalogServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting catalog information of the customer's website.
+   * 
+ */ + public abstract static class CatalogServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a catalog item.
+     * 
+ */ + public void createCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateCatalogItemMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a specific catalog item.
+     * 
+ */ + public void getCatalogItem( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetCatalogItemMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a list of catalog items.
+     * 
+ */ + public void listCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListCatalogItemsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a catalog item. Partial updating is supported. Non-existing
+     * items will be created.
+     * 
+ */ + public void updateCatalogItem( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateCatalogItemMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a catalog item.
+     * 
+ */ + public void deleteCatalogItem( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteCatalogItemMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple catalog items. Request processing may be
+     * synchronous. No partial updating supported. Non-existing items will be
+     * created.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully updated.
+     * 
+ */ + public void importCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getImportCatalogItemsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateCatalogItemMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem>( + this, METHODID_CREATE_CATALOG_ITEM))) + .addMethod( + getGetCatalogItemMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem>( + this, METHODID_GET_CATALOG_ITEM))) + .addMethod( + getListCatalogItemsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse>( + this, METHODID_LIST_CATALOG_ITEMS))) + .addMethod( + getUpdateCatalogItemMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest, + com.google.cloud.recommendationengine.v1beta1.CatalogItem>( + this, METHODID_UPDATE_CATALOG_ITEM))) + .addMethod( + getDeleteCatalogItemMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_CATALOG_ITEM))) + .addMethod( + getImportCatalogItemsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_CATALOG_ITEMS))) + .build(); + } + } + + /** + * + * + *
+   * Service for ingesting catalog information of the customer's website.
+   * 
+ */ + public static final class CatalogServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CatalogServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a catalog item.
+     * 
+ */ + public void createCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateCatalogItemMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a specific catalog item.
+     * 
+ */ + public void getCatalogItem( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetCatalogItemMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a list of catalog items.
+     * 
+ */ + public void listCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListCatalogItemsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a catalog item. Partial updating is supported. Non-existing
+     * items will be created.
+     * 
+ */ + public void updateCatalogItem( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateCatalogItemMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a catalog item.
+     * 
+ */ + public void deleteCatalogItem( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteCatalogItemMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple catalog items. Request processing may be
+     * synchronous. No partial updating supported. Non-existing items will be
+     * created.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully updated.
+     * 
+ */ + public void importCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getImportCatalogItemsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for ingesting catalog information of the customer's website.
+   * 
+ */ + public static final class CatalogServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CatalogServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a catalog item.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem createCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest request) { + return blockingUnaryCall( + getChannel(), getCreateCatalogItemMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a specific catalog item.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest request) { + return blockingUnaryCall(getChannel(), getGetCatalogItemMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a list of catalog items.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse listCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest request) { + return blockingUnaryCall( + getChannel(), getListCatalogItemsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a catalog item. Partial updating is supported. Non-existing
+     * items will be created.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem updateCatalogItem( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateCatalogItemMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a catalog item.
+     * 
+ */ + public com.google.protobuf.Empty deleteCatalogItem( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteCatalogItemMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of multiple catalog items. Request processing may be
+     * synchronous. No partial updating supported. Non-existing items will be
+     * created.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully updated.
+     * 
+ */ + public com.google.longrunning.Operation importCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest request) { + return blockingUnaryCall( + getChannel(), getImportCatalogItemsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for ingesting catalog information of the customer's website.
+   * 
+ */ + public static final class CatalogServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CatalogServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a catalog item.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + createCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateCatalogItemMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a specific catalog item.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + getCatalogItem( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetCatalogItemMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a list of catalog items.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse> + listCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListCatalogItemsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a catalog item. Partial updating is supported. Non-existing
+     * items will be created.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.CatalogItem> + updateCatalogItem( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateCatalogItemMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a catalog item.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCatalogItem( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteCatalogItemMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of multiple catalog items. Request processing may be
+     * synchronous. No partial updating supported. Non-existing items will be
+     * created.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importCatalogItems( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest request) { + return futureUnaryCall( + getChannel().newCall(getImportCatalogItemsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_CATALOG_ITEM = 0; + private static final int METHODID_GET_CATALOG_ITEM = 1; + private static final int METHODID_LIST_CATALOG_ITEMS = 2; + private static final int METHODID_UPDATE_CATALOG_ITEM = 3; + private static final int METHODID_DELETE_CATALOG_ITEM = 4; + private static final int METHODID_IMPORT_CATALOG_ITEMS = 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 CatalogServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CatalogServiceImplBase 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_CREATE_CATALOG_ITEM: + serviceImpl.createCatalogItem( + (com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.CatalogItem>) + responseObserver); + break; + case METHODID_GET_CATALOG_ITEM: + serviceImpl.getCatalogItem( + (com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.CatalogItem>) + responseObserver); + break; + case METHODID_LIST_CATALOG_ITEMS: + serviceImpl.listCatalogItems( + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse>) + responseObserver); + break; + case METHODID_UPDATE_CATALOG_ITEM: + serviceImpl.updateCatalogItem( + (com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.CatalogItem>) + responseObserver); + break; + case METHODID_DELETE_CATALOG_ITEM: + serviceImpl.deleteCatalogItem( + (com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_CATALOG_ITEMS: + serviceImpl.importCatalogItems( + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) 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 CatalogServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CatalogServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CatalogService"); + } + } + + private static final class CatalogServiceFileDescriptorSupplier + extends CatalogServiceBaseDescriptorSupplier { + CatalogServiceFileDescriptorSupplier() {} + } + + private static final class CatalogServiceMethodDescriptorSupplier + extends CatalogServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CatalogServiceMethodDescriptorSupplier(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 (CatalogServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CatalogServiceFileDescriptorSupplier()) + .addMethod(getCreateCatalogItemMethod()) + .addMethod(getGetCatalogItemMethod()) + .addMethod(getListCatalogItemsMethod()) + .addMethod(getUpdateCatalogItemMethod()) + .addMethod(getDeleteCatalogItemMethod()) + .addMethod(getImportCatalogItemsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryGrpc.java b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryGrpc.java new file mode 100644 index 00000000..ed15541d --- /dev/null +++ b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryGrpc.java @@ -0,0 +1,700 @@ +/* + * 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.recommendationengine.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service for registering API keys for use with the `predict` method. If you
+ * use an API key to request predictions, you must first register the API key.
+ * Otherwise, your prediction request is rejected. If you use OAuth to
+ * authenticate your `predict` method call, you do not need to register an API
+ * key. You can register up to 20 API keys per project.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = + "Source: google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto") +public final class PredictionApiKeyRegistryGrpc { + + private PredictionApiKeyRegistryGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + getCreatePredictionApiKeyRegistrationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePredictionApiKeyRegistration", + requestType = + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + .class, + responseType = + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + getCreatePredictionApiKeyRegistrationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + getCreatePredictionApiKeyRegistrationMethod; + if ((getCreatePredictionApiKeyRegistrationMethod = + PredictionApiKeyRegistryGrpc.getCreatePredictionApiKeyRegistrationMethod) + == null) { + synchronized (PredictionApiKeyRegistryGrpc.class) { + if ((getCreatePredictionApiKeyRegistrationMethod = + PredictionApiKeyRegistryGrpc.getCreatePredictionApiKeyRegistrationMethod) + == null) { + PredictionApiKeyRegistryGrpc.getCreatePredictionApiKeyRegistrationMethod = + getCreatePredictionApiKeyRegistrationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "CreatePredictionApiKeyRegistration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1 + .PredictionApiKeyRegistration.getDefaultInstance())) + .setSchemaDescriptor( + new PredictionApiKeyRegistryMethodDescriptorSupplier( + "CreatePredictionApiKeyRegistration")) + .build(); + } + } + } + return getCreatePredictionApiKeyRegistrationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest, + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse> + getListPredictionApiKeyRegistrationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPredictionApiKeyRegistrations", + requestType = + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .class, + responseType = + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + .class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest, + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse> + getListPredictionApiKeyRegistrationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest, + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse> + getListPredictionApiKeyRegistrationsMethod; + if ((getListPredictionApiKeyRegistrationsMethod = + PredictionApiKeyRegistryGrpc.getListPredictionApiKeyRegistrationsMethod) + == null) { + synchronized (PredictionApiKeyRegistryGrpc.class) { + if ((getListPredictionApiKeyRegistrationsMethod = + PredictionApiKeyRegistryGrpc.getListPredictionApiKeyRegistrationsMethod) + == null) { + PredictionApiKeyRegistryGrpc.getListPredictionApiKeyRegistrationsMethod = + getListPredictionApiKeyRegistrationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListPredictionApiKeyRegistrations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new PredictionApiKeyRegistryMethodDescriptorSupplier( + "ListPredictionApiKeyRegistrations")) + .build(); + } + } + } + return getListPredictionApiKeyRegistrationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest, + com.google.protobuf.Empty> + getDeletePredictionApiKeyRegistrationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePredictionApiKeyRegistration", + requestType = + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + .class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest, + com.google.protobuf.Empty> + getDeletePredictionApiKeyRegistrationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest, + com.google.protobuf.Empty> + getDeletePredictionApiKeyRegistrationMethod; + if ((getDeletePredictionApiKeyRegistrationMethod = + PredictionApiKeyRegistryGrpc.getDeletePredictionApiKeyRegistrationMethod) + == null) { + synchronized (PredictionApiKeyRegistryGrpc.class) { + if ((getDeletePredictionApiKeyRegistrationMethod = + PredictionApiKeyRegistryGrpc.getDeletePredictionApiKeyRegistrationMethod) + == null) { + PredictionApiKeyRegistryGrpc.getDeletePredictionApiKeyRegistrationMethod = + getDeletePredictionApiKeyRegistrationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "DeletePredictionApiKeyRegistration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new PredictionApiKeyRegistryMethodDescriptorSupplier( + "DeletePredictionApiKeyRegistration")) + .build(); + } + } + } + return getDeletePredictionApiKeyRegistrationMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PredictionApiKeyRegistryStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionApiKeyRegistryStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionApiKeyRegistryStub(channel, callOptions); + } + }; + return PredictionApiKeyRegistryStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PredictionApiKeyRegistryBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionApiKeyRegistryBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionApiKeyRegistryBlockingStub(channel, callOptions); + } + }; + return PredictionApiKeyRegistryBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PredictionApiKeyRegistryFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionApiKeyRegistryFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionApiKeyRegistryFutureStub(channel, callOptions); + } + }; + return PredictionApiKeyRegistryFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for registering API keys for use with the `predict` method. If you
+   * use an API key to request predictions, you must first register the API key.
+   * Otherwise, your prediction request is rejected. If you use OAuth to
+   * authenticate your `predict` method call, you do not need to register an API
+   * key. You can register up to 20 API keys per project.
+   * 
+ */ + public abstract static class PredictionApiKeyRegistryImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Register an API key for use with predict method.
+     * 
+ */ + public void createPredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + responseObserver) { + asyncUnimplementedUnaryCall(getCreatePredictionApiKeyRegistrationMethod(), responseObserver); + } + + /** + * + * + *
+     * List the registered apiKeys for use with predict method.
+     * 
+ */ + public void listPredictionApiKeyRegistrations( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListPredictionApiKeyRegistrationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Unregister an apiKey from using for predict method.
+     * 
+ */ + public void deletePredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeletePredictionApiKeyRegistrationMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreatePredictionApiKeyRegistrationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration>( + this, METHODID_CREATE_PREDICTION_API_KEY_REGISTRATION))) + .addMethod( + getListPredictionApiKeyRegistrationsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest, + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse>( + this, METHODID_LIST_PREDICTION_API_KEY_REGISTRATIONS))) + .addMethod( + getDeletePredictionApiKeyRegistrationMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PREDICTION_API_KEY_REGISTRATION))) + .build(); + } + } + + /** + * + * + *
+   * Service for registering API keys for use with the `predict` method. If you
+   * use an API key to request predictions, you must first register the API key.
+   * Otherwise, your prediction request is rejected. If you use OAuth to
+   * authenticate your `predict` method call, you do not need to register an API
+   * key. You can register up to 20 API keys per project.
+   * 
+ */ + public static final class PredictionApiKeyRegistryStub + extends io.grpc.stub.AbstractAsyncStub { + private PredictionApiKeyRegistryStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionApiKeyRegistryStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionApiKeyRegistryStub(channel, callOptions); + } + + /** + * + * + *
+     * Register an API key for use with predict method.
+     * 
+ */ + public void createPredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreatePredictionApiKeyRegistrationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List the registered apiKeys for use with predict method.
+     * 
+ */ + public void listPredictionApiKeyRegistrations( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListPredictionApiKeyRegistrationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Unregister an apiKey from using for predict method.
+     * 
+ */ + public void deletePredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeletePredictionApiKeyRegistrationMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for registering API keys for use with the `predict` method. If you
+   * use an API key to request predictions, you must first register the API key.
+   * Otherwise, your prediction request is rejected. If you use OAuth to
+   * authenticate your `predict` method call, you do not need to register an API
+   * key. You can register up to 20 API keys per project.
+   * 
+ */ + public static final class PredictionApiKeyRegistryBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PredictionApiKeyRegistryBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionApiKeyRegistryBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionApiKeyRegistryBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Register an API key for use with predict method.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + createPredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + request) { + return blockingUnaryCall( + getChannel(), getCreatePredictionApiKeyRegistrationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List the registered apiKeys for use with predict method.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + listPredictionApiKeyRegistrations( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + request) { + return blockingUnaryCall( + getChannel(), getListPredictionApiKeyRegistrationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Unregister an apiKey from using for predict method.
+     * 
+ */ + public com.google.protobuf.Empty deletePredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + request) { + return blockingUnaryCall( + getChannel(), getDeletePredictionApiKeyRegistrationMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for registering API keys for use with the `predict` method. If you
+   * use an API key to request predictions, you must first register the API key.
+   * Otherwise, your prediction request is rejected. If you use OAuth to
+   * authenticate your `predict` method call, you do not need to register an API
+   * key. You can register up to 20 API keys per project.
+   * 
+ */ + public static final class PredictionApiKeyRegistryFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PredictionApiKeyRegistryFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionApiKeyRegistryFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionApiKeyRegistryFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Register an API key for use with predict method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + createPredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + request) { + return futureUnaryCall( + getChannel().newCall(getCreatePredictionApiKeyRegistrationMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * List the registered apiKeys for use with predict method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse> + listPredictionApiKeyRegistrations( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + request) { + return futureUnaryCall( + getChannel().newCall(getListPredictionApiKeyRegistrationsMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Unregister an apiKey from using for predict method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deletePredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + request) { + return futureUnaryCall( + getChannel().newCall(getDeletePredictionApiKeyRegistrationMethod(), getCallOptions()), + request); + } + } + + private static final int METHODID_CREATE_PREDICTION_API_KEY_REGISTRATION = 0; + private static final int METHODID_LIST_PREDICTION_API_KEY_REGISTRATIONS = 1; + private static final int METHODID_DELETE_PREDICTION_API_KEY_REGISTRATION = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final PredictionApiKeyRegistryImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PredictionApiKeyRegistryImplBase 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_CREATE_PREDICTION_API_KEY_REGISTRATION: + serviceImpl.createPredictionApiKeyRegistration( + (com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration>) + responseObserver); + break; + case METHODID_LIST_PREDICTION_API_KEY_REGISTRATIONS: + serviceImpl.listPredictionApiKeyRegistrations( + (com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse>) + responseObserver); + break; + case METHODID_DELETE_PREDICTION_API_KEY_REGISTRATION: + serviceImpl.deletePredictionApiKeyRegistration( + (com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest) + 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 PredictionApiKeyRegistryBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PredictionApiKeyRegistryBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PredictionApiKeyRegistry"); + } + } + + private static final class PredictionApiKeyRegistryFileDescriptorSupplier + extends PredictionApiKeyRegistryBaseDescriptorSupplier { + PredictionApiKeyRegistryFileDescriptorSupplier() {} + } + + private static final class PredictionApiKeyRegistryMethodDescriptorSupplier + extends PredictionApiKeyRegistryBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PredictionApiKeyRegistryMethodDescriptorSupplier(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 (PredictionApiKeyRegistryGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PredictionApiKeyRegistryFileDescriptorSupplier()) + .addMethod(getCreatePredictionApiKeyRegistrationMethod()) + .addMethod(getListPredictionApiKeyRegistrationsMethod()) + .addMethod(getDeletePredictionApiKeyRegistrationMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceGrpc.java b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceGrpc.java new file mode 100644 index 00000000..70f87267 --- /dev/null +++ b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceGrpc.java @@ -0,0 +1,378 @@ +/* + * 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.recommendationengine.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service for making recommendation prediction.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/recommendationengine/v1beta1/prediction_service.proto") +public final class PredictionServiceGrpc { + + private PredictionServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.recommendationengine.v1beta1.PredictionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.PredictRequest, + com.google.cloud.recommendationengine.v1beta1.PredictResponse> + getPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Predict", + requestType = com.google.cloud.recommendationengine.v1beta1.PredictRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.PredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.PredictRequest, + com.google.cloud.recommendationengine.v1beta1.PredictResponse> + getPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.PredictRequest, + com.google.cloud.recommendationengine.v1beta1.PredictResponse> + getPredictMethod; + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + PredictionServiceGrpc.getPredictMethod = + getPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Predict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.PredictRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.PredictResponse + .getDefaultInstance())) + .setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Predict")) + .build(); + } + } + } + return getPredictMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PredictionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + }; + return PredictionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PredictionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + }; + return PredictionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PredictionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + }; + return PredictionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public abstract static class PredictionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Makes a recommendation prediction. If using API Key based authentication,
+     * the API Key must be registered using the
+     * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry]
+     * service. [Learn more](/recommendations-ai/docs/setting-up#register-key).
+     * 
+ */ + public void predict( + com.google.cloud.recommendationengine.v1beta1.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getPredictMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getPredictMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.PredictRequest, + com.google.cloud.recommendationengine.v1beta1.PredictResponse>( + this, METHODID_PREDICT))) + .build(); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private PredictionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction. If using API Key based authentication,
+     * the API Key must be registered using the
+     * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry]
+     * service. [Learn more](/recommendations-ai/docs/setting-up#register-key).
+     * 
+ */ + public void predict( + com.google.cloud.recommendationengine.v1beta1.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PredictionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction. If using API Key based authentication,
+     * the API Key must be registered using the
+     * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry]
+     * service. [Learn more](/recommendations-ai/docs/setting-up#register-key).
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse predict( + com.google.cloud.recommendationengine.v1beta1.PredictRequest request) { + return blockingUnaryCall(getChannel(), getPredictMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PredictionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction. If using API Key based authentication,
+     * the API Key must be registered using the
+     * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry]
+     * service. [Learn more](/recommendations-ai/docs/setting-up#register-key).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.PredictResponse> + predict(com.google.cloud.recommendationengine.v1beta1.PredictRequest request) { + return futureUnaryCall(getChannel().newCall(getPredictMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_PREDICT = 0; + + 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 PredictionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PredictionServiceImplBase 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_PREDICT: + serviceImpl.predict( + (com.google.cloud.recommendationengine.v1beta1.PredictRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.PredictResponse>) + 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 PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PredictionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PredictionService"); + } + } + + private static final class PredictionServiceFileDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier { + PredictionServiceFileDescriptorSupplier() {} + } + + private static final class PredictionServiceMethodDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PredictionServiceMethodDescriptorSupplier(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 (PredictionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier()) + .addMethod(getPredictMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceGrpc.java b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceGrpc.java new file mode 100644 index 00000000..710199f9 --- /dev/null +++ b/grpc-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceGrpc.java @@ -0,0 +1,879 @@ +/* + * 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.recommendationengine.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service for ingesting end user actions on the customer website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/recommendationengine/v1beta1/user_event_service.proto") +public final class UserEventServiceGrpc { + + private UserEventServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.recommendationengine.v1beta1.UserEventService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest, + com.google.cloud.recommendationengine.v1beta1.UserEvent> + getWriteUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteUserEvent", + requestType = com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.UserEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest, + com.google.cloud.recommendationengine.v1beta1.UserEvent> + getWriteUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest, + com.google.cloud.recommendationengine.v1beta1.UserEvent> + getWriteUserEventMethod; + if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { + UserEventServiceGrpc.getWriteUserEventMethod = + getWriteUserEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteUserEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.UserEvent + .getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("WriteUserEvent")) + .build(); + } + } + } + return getWriteUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest, + com.google.api.HttpBody> + getCollectUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CollectUserEvent", + requestType = com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.class, + responseType = com.google.api.HttpBody.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest, + com.google.api.HttpBody> + getCollectUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest, + com.google.api.HttpBody> + getCollectUserEventMethod; + if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { + UserEventServiceGrpc.getCollectUserEventMethod = + getCollectUserEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CollectUserEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.HttpBody.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("CollectUserEvent")) + .build(); + } + } + } + return getCollectUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse> + getListUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUserEvents", + requestType = com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest.class, + responseType = com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse> + getListUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse> + getListUserEventsMethod; + if ((getListUserEventsMethod = UserEventServiceGrpc.getListUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getListUserEventsMethod = UserEventServiceGrpc.getListUserEventsMethod) == null) { + UserEventServiceGrpc.getListUserEventsMethod = + getListUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("ListUserEvents")) + .build(); + } + } + } + return getListUserEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest, + com.google.longrunning.Operation> + getPurgeUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PurgeUserEvents", + requestType = com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest, + com.google.longrunning.Operation> + getPurgeUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest, + com.google.longrunning.Operation> + getPurgeUserEventsMethod; + if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { + UserEventServiceGrpc.getPurgeUserEventsMethod = + getPurgeUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PurgeUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("PurgeUserEvents")) + .build(); + } + } + } + return getPurgeUserEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportUserEvents", + requestType = com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod; + if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { + UserEventServiceGrpc.getImportUserEventsMethod = + getImportUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("ImportUserEvents")) + .build(); + } + } + } + return getImportUserEventsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static UserEventServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceStub(channel, callOptions); + } + }; + return UserEventServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static UserEventServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceBlockingStub(channel, callOptions); + } + }; + return UserEventServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static UserEventServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceFutureStub(channel, callOptions); + } + }; + return UserEventServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public abstract static class UserEventServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public void writeUserEvent( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getWriteUserEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Recommendations AI JavaScript pixel.
+     * Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCollectUserEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a list of user events within a time range, with potential filtering.
+     * 
+ */ + public void listUserEvents( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListUserEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public void purgeUserEvents( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getPurgeUserEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of User events. Request processing might be
+     * synchronous. Events that already exist are skipped.
+     * Use this method for backfilling historical user events.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully inserted.
+     * Operation.metadata is of type ImportMetadata.
+     * 
+ */ + public void importUserEvents( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getImportUserEventsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getWriteUserEventMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest, + com.google.cloud.recommendationengine.v1beta1.UserEvent>( + this, METHODID_WRITE_USER_EVENT))) + .addMethod( + getCollectUserEventMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest, + com.google.api.HttpBody>(this, METHODID_COLLECT_USER_EVENT))) + .addMethod( + getListUserEventsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse>( + this, METHODID_LIST_USER_EVENTS))) + .addMethod( + getPurgeUserEventsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_PURGE_USER_EVENTS))) + .addMethod( + getImportUserEventsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_USER_EVENTS))) + .build(); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private UserEventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public void writeUserEvent( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Recommendations AI JavaScript pixel.
+     * Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a list of user events within a time range, with potential filtering.
+     * 
+ */ + public void listUserEvents( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public void purgeUserEvents( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of User events. Request processing might be
+     * synchronous. Events that already exist are skipped.
+     * Use this method for backfilling historical user events.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully inserted.
+     * Operation.metadata is of type ImportMetadata.
+     * 
+ */ + public void importUserEvents( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private UserEventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent writeUserEvent( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest request) { + return blockingUnaryCall(getChannel(), getWriteUserEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Recommendations AI JavaScript pixel.
+     * Users should not call this method directly.
+     * 
+ */ + public com.google.api.HttpBody collectUserEvent( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest request) { + return blockingUnaryCall( + getChannel(), getCollectUserEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a list of user events within a time range, with potential filtering.
+     * 
+ */ + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse listUserEvents( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest request) { + return blockingUnaryCall(getChannel(), getListUserEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public com.google.longrunning.Operation purgeUserEvents( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest request) { + return blockingUnaryCall(getChannel(), getPurgeUserEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of User events. Request processing might be
+     * synchronous. Events that already exist are skipped.
+     * Use this method for backfilling historical user events.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully inserted.
+     * Operation.metadata is of type ImportMetadata.
+     * 
+ */ + public com.google.longrunning.Operation importUserEvents( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest request) { + return blockingUnaryCall( + getChannel(), getImportUserEventsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private UserEventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.UserEvent> + writeUserEvent( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest request) { + return futureUnaryCall( + getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Recommendations AI JavaScript pixel.
+     * Users should not call this method directly.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + collectUserEvent( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest request) { + return futureUnaryCall( + getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a list of user events within a time range, with potential filtering.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse> + listUserEvents( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListUserEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + purgeUserEvents( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest request) { + return futureUnaryCall( + getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of User events. Request processing might be
+     * synchronous. Events that already exist are skipped.
+     * Use this method for backfilling historical user events.
+     * Operation.response is of type ImportResponse. Note that it is
+     * possible for a subset of the items to be successfully inserted.
+     * Operation.metadata is of type ImportMetadata.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importUserEvents( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest request) { + return futureUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_WRITE_USER_EVENT = 0; + private static final int METHODID_COLLECT_USER_EVENT = 1; + private static final int METHODID_LIST_USER_EVENTS = 2; + private static final int METHODID_PURGE_USER_EVENTS = 3; + private static final int METHODID_IMPORT_USER_EVENTS = 4; + + 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 UserEventServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(UserEventServiceImplBase 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_WRITE_USER_EVENT: + serviceImpl.writeUserEvent( + (com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COLLECT_USER_EVENT: + serviceImpl.collectUserEvent( + (com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_USER_EVENTS: + serviceImpl.listUserEvents( + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse>) + responseObserver); + break; + case METHODID_PURGE_USER_EVENTS: + serviceImpl.purgeUserEvents( + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_USER_EVENTS: + serviceImpl.importUserEvents( + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) 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 UserEventServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + UserEventServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("UserEventService"); + } + } + + private static final class UserEventServiceFileDescriptorSupplier + extends UserEventServiceBaseDescriptorSupplier { + UserEventServiceFileDescriptorSupplier() {} + } + + private static final class UserEventServiceMethodDescriptorSupplier + extends UserEventServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + UserEventServiceMethodDescriptorSupplier(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 (UserEventServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new UserEventServiceFileDescriptorSupplier()) + .addMethod(getWriteUserEventMethod()) + .addMethod(getCollectUserEventMethod()) + .addMethod(getListUserEventsMethod()) + .addMethod(getPurgeUserEventsMethod()) + .addMethod(getImportUserEventsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..abe1a9b1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,256 @@ + + + 4.0.0 + com.google.cloud + google-cloud-recommendations-ai-parent + pom + 0.0.1-SNAPSHOT + Google Recommendations AI Parent + https://github.com/googleapis/java-recommendations-ai + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.4.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-recommendations-ai.git + scm:git:git@github.com:googleapis/java-recommendations-ai.git + https://github.com/googleapis/java-recommendations-ai + HEAD + + + https://github.com/googleapis/java-recommendations-ai/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-recommendations-ai-parent + 1.91.1 + 1.8.1 + 1.17.0 + 1.54.0 + 1.27.2 + 3.11.4 + 4.13 + 28.2-android + 1.4.1 + 1.3.2 + 1.18 + + + + + + com.google.cloud + google-cloud-recommendations-ai + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-recommendations-ai-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-recommendations-ai-v1beta1 + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + com.google.api + gax-bom + ${gax.version} + pom + import + + + com.google.guava + guava-bom + ${guava.version} + pom + import + + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.api + api-common + ${google.api-common.version} + + + com.google.api.grpc + proto-google-common-protos + ${google.common-protos.version} + + + org.threeten + threetenbp + ${threeten.version} + + + javax.annotation + javax.annotation-api + ${javax.annotations.version} + + + org.codehaus.mojo + animal-sniffer-annotations + ${animal-sniffer.version} + + + + junit + junit + ${junit.version} + test + + + com.google.api + gax-grpc + ${gax.version} + testlib + test + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + google-cloud-recommendations-ai + proto-google-cloud-recommendations-ai-v1beta1 + grpc-google-cloud-recommendations-ai-v1beta1 + google-cloud-recommendations-ai-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + 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.1.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/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-recommendations-ai-v1beta1/pom.xml b/proto-google-cloud-recommendations-ai-v1beta1/pom.xml new file mode 100644 index 00000000..d2ba6ab8 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-recommendations-ai-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-recommendations-ai-v1beta1 + PROTO library for proto-google-cloud-recommendations-ai-v1beta1 + + com.google.cloud + google-cloud-recommendations-ai-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBody.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBody.java new file mode 100644 index 00000000..f479585a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBody.java @@ -0,0 +1,1271 @@ +/* + * 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/api/httpbody.proto + +package com.google.api; + +/** + * + * + *
+ * Message that represents an arbitrary HTTP body. It should only be used for
+ * payload formats that can't be represented as JSON, such as raw binary or
+ * an HTML page.
+ * This message can be used both in streaming and non-streaming API methods in
+ * the request as well as the response.
+ * It can be used as a top-level request field, which is convenient if one
+ * wants to extract parameters from either the URL or HTTP template into the
+ * request fields and also want access to the raw HTTP body.
+ * Example:
+ *     message GetResourceRequest {
+ *       // A unique request id.
+ *       string request_id = 1;
+ *       // The raw HTTP body is bound to this field.
+ *       google.api.HttpBody http_body = 2;
+ *     }
+ *     service ResourceService {
+ *       rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
+ *       rpc UpdateResource(google.api.HttpBody) returns
+ *       (google.protobuf.Empty);
+ *     }
+ * Example with streaming methods:
+ *     service CaldavService {
+ *       rpc GetCalendar(stream google.api.HttpBody)
+ *         returns (stream google.api.HttpBody);
+ *       rpc UpdateCalendar(stream google.api.HttpBody)
+ *         returns (stream google.api.HttpBody);
+ *     }
+ * Use of this type only changes how the request and response bodies are
+ * handled, all other features will continue to work unchanged.
+ * 
+ * + * Protobuf type {@code google.api.HttpBody} + */ +public final class HttpBody extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.HttpBody) + HttpBodyOrBuilder { + private static final long serialVersionUID = 0L; + // Use HttpBody.newBuilder() to construct. + private HttpBody(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HttpBody() { + contentType_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + extensions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HttpBody(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HttpBody( + 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(); + + contentType_ = s; + break; + } + case 18: + { + data_ = input.readBytes(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + extensions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + extensions_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.HttpBody.class, com.google.api.HttpBody.Builder.class); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object contentType_; + /** + * + * + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + 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(); + contentType_ = s; + return s; + } + } + /** + * + * + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * + * + *
+   * The HTTP request/response body as raw binary.
+   * 
+ * + * bytes data = 2; + * + * @return The data. + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int EXTENSIONS_FIELD_NUMBER = 3; + private java.util.List extensions_; + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List getExtensionsList() { + return extensions_; + } + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List getExtensionsOrBuilderList() { + return extensions_; + } + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public int getExtensionsCount() { + return extensions_.size(); + } + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any getExtensions(int index) { + return extensions_.get(index); + } + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index) { + return extensions_.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 (!getContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contentType_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + for (int i = 0; i < extensions_.size(); i++) { + output.writeMessage(3, extensions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contentType_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, data_); + } + for (int i = 0; i < extensions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, extensions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.HttpBody)) { + return super.equals(obj); + } + com.google.api.HttpBody other = (com.google.api.HttpBody) obj; + + if (!getContentType().equals(other.getContentType())) return false; + if (!getData().equals(other.getData())) return false; + if (!getExtensionsList().equals(other.getExtensionsList())) 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_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (getExtensionsCount() > 0) { + hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExtensionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.HttpBody parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.HttpBody parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.HttpBody parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.HttpBody 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.api.HttpBody parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.HttpBody parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.HttpBody parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.HttpBody 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.api.HttpBody parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.HttpBody 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.api.HttpBody parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.HttpBody 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.api.HttpBody 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; + } + /** + * + * + *
+   * Message that represents an arbitrary HTTP body. It should only be used for
+   * payload formats that can't be represented as JSON, such as raw binary or
+   * an HTML page.
+   * This message can be used both in streaming and non-streaming API methods in
+   * the request as well as the response.
+   * It can be used as a top-level request field, which is convenient if one
+   * wants to extract parameters from either the URL or HTTP template into the
+   * request fields and also want access to the raw HTTP body.
+   * Example:
+   *     message GetResourceRequest {
+   *       // A unique request id.
+   *       string request_id = 1;
+   *       // The raw HTTP body is bound to this field.
+   *       google.api.HttpBody http_body = 2;
+   *     }
+   *     service ResourceService {
+   *       rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
+   *       rpc UpdateResource(google.api.HttpBody) returns
+   *       (google.protobuf.Empty);
+   *     }
+   * Example with streaming methods:
+   *     service CaldavService {
+   *       rpc GetCalendar(stream google.api.HttpBody)
+   *         returns (stream google.api.HttpBody);
+   *       rpc UpdateCalendar(stream google.api.HttpBody)
+   *         returns (stream google.api.HttpBody);
+   *     }
+   * Use of this type only changes how the request and response bodies are
+   * handled, all other features will continue to work unchanged.
+   * 
+ * + * Protobuf type {@code google.api.HttpBody} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.HttpBody) + com.google.api.HttpBodyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.HttpBody.class, com.google.api.HttpBody.Builder.class); + } + + // Construct using com.google.api.HttpBody.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExtensionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + contentType_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + extensionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; + } + + @java.lang.Override + public com.google.api.HttpBody getDefaultInstanceForType() { + return com.google.api.HttpBody.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.HttpBody build() { + com.google.api.HttpBody result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.HttpBody buildPartial() { + com.google.api.HttpBody result = new com.google.api.HttpBody(this); + int from_bitField0_ = bitField0_; + result.contentType_ = contentType_; + result.data_ = data_; + if (extensionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.extensions_ = extensions_; + } else { + result.extensions_ = extensionsBuilder_.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.api.HttpBody) { + return mergeFrom((com.google.api.HttpBody) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.HttpBody other) { + if (other == com.google.api.HttpBody.getDefaultInstance()) return this; + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (extensionsBuilder_ == null) { + if (!other.extensions_.isEmpty()) { + if (extensions_.isEmpty()) { + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExtensionsIsMutable(); + extensions_.addAll(other.extensions_); + } + onChanged(); + } + } else { + if (!other.extensions_.isEmpty()) { + if (extensionsBuilder_.isEmpty()) { + extensionsBuilder_.dispose(); + extensionsBuilder_ = null; + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000001); + extensionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExtensionsFieldBuilder() + : null; + } else { + extensionsBuilder_.addAllMessages(other.extensions_); + } + } + } + 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.api.HttpBody parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.HttpBody) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object contentType_ = ""; + /** + * + * + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = getDefaultInstance().getContentType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The HTTP request/response body as raw binary.
+     * 
+ * + * bytes data = 2; + * + * @return The data. + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * + * + *
+     * The HTTP request/response body as raw binary.
+     * 
+ * + * bytes data = 2; + * + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The HTTP request/response body as raw binary.
+     * 
+ * + * bytes data = 2; + * + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.util.List extensions_ = java.util.Collections.emptyList(); + + private void ensureExtensionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + extensions_ = new java.util.ArrayList(extensions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + extensionsBuilder_; + + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List getExtensionsList() { + if (extensionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(extensions_); + } else { + return extensionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public int getExtensionsCount() { + if (extensionsBuilder_ == null) { + return extensions_.size(); + } else { + return extensionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any getExtensions(int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); + } else { + return extensionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder setExtensions(int index, com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.set(index, value); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder setExtensions(int index, com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.set(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions(com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(value); + onChanged(); + } else { + extensionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions(int index, com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(index, value); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions(com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions(int index, com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addAllExtensions(java.lang.Iterable values) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, extensions_); + onChanged(); + } else { + extensionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder clearExtensions() { + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + extensionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder removeExtensions(int index) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.remove(index); + onChanged(); + } else { + extensionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any.Builder getExtensionsBuilder(int index) { + return getExtensionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); + } else { + return extensionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List getExtensionsOrBuilderList() { + if (extensionsBuilder_ != null) { + return extensionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(extensions_); + } + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any.Builder addExtensionsBuilder() { + return getExtensionsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any.Builder addExtensionsBuilder(int index) { + return getExtensionsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List getExtensionsBuilderList() { + return getExtensionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getExtensionsFieldBuilder() { + if (extensionsBuilder_ == null) { + extensionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + extensions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + extensions_ = null; + } + return extensionsBuilder_; + } + + @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.api.HttpBody) + } + + // @@protoc_insertion_point(class_scope:google.api.HttpBody) + private static final com.google.api.HttpBody DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.HttpBody(); + } + + public static com.google.api.HttpBody getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpBody parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpBody(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.api.HttpBody getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBodyOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBodyOrBuilder.java new file mode 100644 index 00000000..c1749af4 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBodyOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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/api/httpbody.proto + +package com.google.api; + +public interface HttpBodyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.HttpBody) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * + * @return The contentType. + */ + java.lang.String getContentType(); + /** + * + * + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString getContentTypeBytes(); + + /** + * + * + *
+   * The HTTP request/response body as raw binary.
+   * 
+ * + * bytes data = 2; + * + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + java.util.List getExtensionsList(); + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + com.google.protobuf.Any getExtensions(int index); + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + int getExtensionsCount(); + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + java.util.List getExtensionsOrBuilderList(); + /** + * + * + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBodyProto.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBodyProto.java new file mode 100644 index 00000000..b136b692 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/api/HttpBodyProto.java @@ -0,0 +1,68 @@ +/* + * 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/api/httpbody.proto + +package com.google.api; + +public final class HttpBodyProto { + private HttpBodyProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_HttpBody_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_HttpBody_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\031google/api/httpbody.proto\022\ngoogle.api\032" + + "\031google/protobuf/any.proto\"X\n\010HttpBody\022\024" + + "\n\014content_type\030\001 \001(\t\022\014\n\004data\030\002 \001(\014\022(\n\nex" + + "tensions\030\003 \003(\0132\024.google.protobuf.AnyBh\n\016" + + "com.google.apiB\rHttpBodyProtoP\001Z;google." + + "golang.org/genproto/googleapis/api/httpb" + + "ody;httpbody\370\001\001\242\002\004GAPIb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + }); + internal_static_google_api_HttpBody_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_HttpBody_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_HttpBody_descriptor, + new java.lang.String[] { + "ContentType", "Data", "Extensions", + }); + com.google.protobuf.AnyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Catalog.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Catalog.java new file mode 100644 index 00000000..e3528763 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Catalog.java @@ -0,0 +1,218 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class Catalog { + private Catalog() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_CostsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_CostsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_Image_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_Image_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/recommendationengine/v1be" + + "ta1/catalog.proto\022)google.cloud.recommen" + + "dationengine.v1beta1\032\037google/api/field_b" + + "ehavior.proto\0326google/cloud/recommendati" + + "onengine/v1beta1/common.proto\032\034google/pr" + + "otobuf/struct.proto\032\034google/api/annotati" + + "ons.proto\"\376\003\n\013CatalogItem\022\017\n\002id\030\001 \001(\tB\003\340" + + "A\002\022k\n\024category_hierarchies\030\002 \003(\0132H.googl" + + "e.cloud.recommendationengine.v1beta1.Cat" + + "alogItem.CategoryHierarchyB\003\340A\002\022\022\n\005title" + + "\030\003 \001(\tB\003\340A\002\022\030\n\013description\030\004 \001(\tB\003\340A\001\022S\n" + + "\017item_attributes\030\005 \001(\01325.google.cloud.re" + + "commendationengine.v1beta1.FeatureMapB\003\340" + + "A\001\022\032\n\rlanguage_code\030\006 \001(\tB\003\340A\001\022\021\n\004tags\030\010" + + " \003(\tB\003\340A\001\022\032\n\ritem_group_id\030\t \001(\tB\003\340A\001\022^\n" + + "\020product_metadata\030\n \001(\0132=.google.cloud.r" + + "ecommendationengine.v1beta1.ProductCatal" + + "ogItemB\003\340A\001H\000\032,\n\021CategoryHierarchy\022\027\n\nca" + + "tegories\030\001 \003(\tB\003\340A\002B\025\n\023recommendation_ty" + + "pe\"\346\006\n\022ProductCatalogItem\022d\n\013exact_price" + + "\030\001 \001(\0132H.google.cloud.recommendationengi" + + "ne.v1beta1.ProductCatalogItem.ExactPrice" + + "B\003\340A\001H\000\022d\n\013price_range\030\002 \001(\0132H.google.cl" + + "oud.recommendationengine.v1beta1.Product" + + "CatalogItem.PriceRangeB\003\340A\001H\000\022\\\n\005costs\030\003" + + " \003(\0132H.google.cloud.recommendationengine" + + ".v1beta1.ProductCatalogItem.CostsEntryB\003" + + "\340A\001\022\032\n\rcurrency_code\030\004 \001(\tB\003\340A\001\022b\n\013stock" + + "_state\030\005 \001(\0162H.google.cloud.recommendati" + + "onengine.v1beta1.ProductCatalogItem.Stoc" + + "kStateB\003\340A\001\022\037\n\022available_quantity\030\006 \001(\003B" + + "\003\340A\001\022\"\n\025canonical_product_uri\030\007 \001(\tB\003\340A\001" + + "\022E\n\006images\030\010 \003(\01320.google.cloud.recommen" + + "dationengine.v1beta1.ImageB\003\340A\001\032E\n\nExact" + + "Price\022\032\n\rdisplay_price\030\001 \001(\002B\003\340A\001\022\033\n\016ori" + + "ginal_price\030\002 \001(\002B\003\340A\001\0320\n\nPriceRange\022\020\n\003" + + "min\030\001 \001(\002B\003\340A\002\022\020\n\003max\030\002 \001(\002B\003\340A\002\032,\n\nCost" + + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\"j" + + "\n\nStockState\022\033\n\027STOCK_STATE_UNSPECIFIED\020" + + "\000\022\014\n\010IN_STOCK\020\000\022\020\n\014OUT_OF_STOCK\020\001\022\014\n\010PRE" + + "ORDER\020\002\022\r\n\tBACKORDER\020\003\032\002\020\001B\007\n\005price\"B\n\005I" + + "mage\022\020\n\003uri\030\001 \001(\tB\003\340A\002\022\023\n\006height\030\002 \001(\005B\003" + + "\340A\001\022\022\n\005width\030\003 \001(\005B\003\340A\001B\304\001\n-com.google.c" + + "loud.recommendationengine.v1beta1P\001Z]goo" + + "gle.golang.org/genproto/googleapis/cloud" + + "/recommendationengine/v1beta1;recommenda" + + "tionengine\242\002\005RECAI\252\002)Google.Cloud.Recomm" + + "endationEngine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Common.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor, + new java.lang.String[] { + "Id", + "CategoryHierarchies", + "Title", + "Description", + "ItemAttributes", + "LanguageCode", + "Tags", + "ItemGroupId", + "ProductMetadata", + "RecommendationType", + }); + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_descriptor, + new java.lang.String[] { + "Categories", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor, + new java.lang.String[] { + "ExactPrice", + "PriceRange", + "Costs", + "CurrencyCode", + "StockState", + "AvailableQuantity", + "CanonicalProductUri", + "Images", + "Price", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_descriptor, + new java.lang.String[] { + "DisplayPrice", "OriginalPrice", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_descriptor, + new java.lang.String[] { + "Min", "Max", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_CostsEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_CostsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_CostsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_Image_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recommendationengine_v1beta1_Image_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_Image_descriptor, + new java.lang.String[] { + "Uri", "Height", "Width", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Common.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogInlineSource.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogInlineSource.java new file mode 100644 index 00000000..0cf8356d --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogInlineSource.java @@ -0,0 +1,1047 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * The inline source for the input config for ImportCatalogItems method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CatalogInlineSource} + */ +public final class CatalogInlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.CatalogInlineSource) + CatalogInlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use CatalogInlineSource.newBuilder() to construct. + private CatalogInlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CatalogInlineSource() { + catalogItems_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CatalogInlineSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CatalogInlineSource( + 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)) { + catalogItems_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.CatalogItem>(); + mutable_bitField0_ |= 0x00000001; + } + catalogItems_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + catalogItems_ = java.util.Collections.unmodifiableList(catalogItems_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.class, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder.class); + } + + public static final int CATALOG_ITEMS_FIELD_NUMBER = 1; + private java.util.List catalogItems_; + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getCatalogItemsList() { + return catalogItems_; + } + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemsOrBuilderList() { + return catalogItems_; + } + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getCatalogItemsCount() { + return catalogItems_.size(); + } + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItems(int index) { + return catalogItems_.get(index); + } + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemsOrBuilder(int index) { + return catalogItems_.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 < catalogItems_.size(); i++) { + output.writeMessage(1, catalogItems_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < catalogItems_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, catalogItems_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource other = + (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) obj; + + if (!getCatalogItemsList().equals(other.getCatalogItemsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCatalogItemsCount() > 0) { + hash = (37 * hash) + CATALOG_ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getCatalogItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource 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.recommendationengine.v1beta1.CatalogInlineSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource 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.recommendationengine.v1beta1.CatalogInlineSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource 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.recommendationengine.v1beta1.CatalogInlineSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + 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.recommendationengine.v1beta1.CatalogInlineSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource 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.recommendationengine.v1beta1.CatalogInlineSource 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 inline source for the input config for ImportCatalogItems method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CatalogInlineSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.CatalogInlineSource) + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.class, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCatalogItemsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (catalogItemsBuilder_ == null) { + catalogItems_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + catalogItemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource build() { + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource buildPartial() { + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource result = + new com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource(this); + int from_bitField0_ = bitField0_; + if (catalogItemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + catalogItems_ = java.util.Collections.unmodifiableList(catalogItems_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.catalogItems_ = catalogItems_; + } else { + result.catalogItems_ = catalogItemsBuilder_.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.recommendationengine.v1beta1.CatalogInlineSource) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.getDefaultInstance()) + return this; + if (catalogItemsBuilder_ == null) { + if (!other.catalogItems_.isEmpty()) { + if (catalogItems_.isEmpty()) { + catalogItems_ = other.catalogItems_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCatalogItemsIsMutable(); + catalogItems_.addAll(other.catalogItems_); + } + onChanged(); + } + } else { + if (!other.catalogItems_.isEmpty()) { + if (catalogItemsBuilder_.isEmpty()) { + catalogItemsBuilder_.dispose(); + catalogItemsBuilder_ = null; + catalogItems_ = other.catalogItems_; + bitField0_ = (bitField0_ & ~0x00000001); + catalogItemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCatalogItemsFieldBuilder() + : null; + } else { + catalogItemsBuilder_.addAllMessages(other.catalogItems_); + } + } + } + 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.recommendationengine.v1beta1.CatalogInlineSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + catalogItems_ = java.util.Collections.emptyList(); + + private void ensureCatalogItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + catalogItems_ = + new java.util.ArrayList( + catalogItems_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + catalogItemsBuilder_; + + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getCatalogItemsList() { + if (catalogItemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(catalogItems_); + } else { + return catalogItemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getCatalogItemsCount() { + if (catalogItemsBuilder_ == null) { + return catalogItems_.size(); + } else { + return catalogItemsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItems(int index) { + if (catalogItemsBuilder_ == null) { + return catalogItems_.get(index); + } else { + return catalogItemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCatalogItems( + int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogItemsIsMutable(); + catalogItems_.set(index, value); + onChanged(); + } else { + catalogItemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCatalogItems( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.set(index, builderForValue.build()); + onChanged(); + } else { + catalogItemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addCatalogItems( + com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogItemsIsMutable(); + catalogItems_.add(value); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addCatalogItems( + int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogItemsIsMutable(); + catalogItems_.add(index, value); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addCatalogItems( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.add(builderForValue.build()); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addCatalogItems( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.add(index, builderForValue.build()); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllCatalogItems( + java.lang.Iterable + values) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, catalogItems_); + onChanged(); + } else { + catalogItemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCatalogItems() { + if (catalogItemsBuilder_ == null) { + catalogItems_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + catalogItemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeCatalogItems(int index) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.remove(index); + onChanged(); + } else { + catalogItemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder getCatalogItemsBuilder( + int index) { + return getCatalogItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemsOrBuilder(int index) { + if (catalogItemsBuilder_ == null) { + return catalogItems_.get(index); + } else { + return catalogItemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemsOrBuilderList() { + if (catalogItemsBuilder_ != null) { + return catalogItemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(catalogItems_); + } + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder + addCatalogItemsBuilder() { + return getCatalogItemsFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder addCatalogItemsBuilder( + int index) { + return getCatalogItemsFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of catalog items to update/create. Recommended max of 10k
+     * items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getCatalogItemsBuilderList() { + return getCatalogItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemsFieldBuilder() { + if (catalogItemsBuilder_ == null) { + catalogItemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder>( + catalogItems_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + catalogItems_ = null; + } + return catalogItemsBuilder_; + } + + @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.recommendationengine.v1beta1.CatalogInlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.CatalogInlineSource) + private static final com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource(); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CatalogInlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CatalogInlineSource(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.recommendationengine.v1beta1.CatalogInlineSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogInlineSourceOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogInlineSourceOrBuilder.java new file mode 100644 index 00000000..a774086a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogInlineSourceOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface CatalogInlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.CatalogInlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getCatalogItemsList(); + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItems(int index); + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getCatalogItemsCount(); + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getCatalogItemsOrBuilderList(); + /** + * + * + *
+   * Optional. A list of catalog items to update/create. Recommended max of 10k
+   * items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder getCatalogItemsOrBuilder( + int index); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItem.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItem.java new file mode 100644 index 00000000..55123d6a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItem.java @@ -0,0 +1,4172 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * CatalogItem captures all metadata information of items to be recommended.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CatalogItem} + */ +public final class CatalogItem extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.CatalogItem) + CatalogItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use CatalogItem.newBuilder() to construct. + private CatalogItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CatalogItem() { + id_ = ""; + categoryHierarchies_ = java.util.Collections.emptyList(); + title_ = ""; + description_ = ""; + languageCode_ = ""; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + itemGroupId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CatalogItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CatalogItem( + 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(); + + id_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + categoryHierarchies_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .CategoryHierarchy>(); + mutable_bitField0_ |= 0x00000001; + } + categoryHierarchies_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .parser(), + extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 42: + { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder subBuilder = null; + if (itemAttributes_ != null) { + subBuilder = itemAttributes_.toBuilder(); + } + itemAttributes_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(itemAttributes_); + itemAttributes_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + tags_.add(s); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + itemGroupId_ = s; + break; + } + case 82: + { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder subBuilder = + null; + if (recommendationTypeCase_ == 10) { + subBuilder = + ((com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_) + .toBuilder(); + } + recommendationType_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_); + recommendationType_ = subBuilder.buildPartial(); + } + recommendationTypeCase_ = 10; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + categoryHierarchies_ = java.util.Collections.unmodifiableList(categoryHierarchies_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + tags_ = tags_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.class, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder.class); + } + + public interface CategoryHierarchyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + java.lang.String getCategories(int index); + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + com.google.protobuf.ByteString getCategoriesBytes(int index); + } + /** + * + * + *
+   * Category represents catalog item category hierarchy.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy} + */ + public static final class CategoryHierarchy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) + CategoryHierarchyOrBuilder { + private static final long serialVersionUID = 0L; + // Use CategoryHierarchy.newBuilder() to construct. + private CategoryHierarchy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CategoryHierarchy() { + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CategoryHierarchy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CategoryHierarchy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + categories_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + categories_ = categories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.class, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + .class); + } + + public static final int CATEGORIES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList categories_; + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_; + } + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+     * Required. Catalog item categories. Each category should be a UTF-8
+     * encoded string with a length limit of 2 KiB.
+     * Note that the order in the list denotes the specificity (from least to
+     * most specific).
+     * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, categories_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy other = + (com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) obj; + + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + 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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + 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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + 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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + 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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + 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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy 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; + } + /** + * + * + *
+     * Category represents catalog item category hierarchy.
+     * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.class, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + .class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.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(); + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_CategoryHierarchy_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy build() { + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy result = + new com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + categories_ = categories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.categories_ = categories_; + 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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .getDefaultInstance()) return this; + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList categories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCategoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_.getUnmodifiableView(); + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Catalog item categories. Each category should be a UTF-8
+       * encoded string with a length limit of 2 KiB.
+       * Note that the order in the list denotes the specificity (from least to
+       * most specific).
+       * 
+ * + * repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy) + private static final com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy(); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CategoryHierarchy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CategoryHierarchy(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.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int recommendationTypeCase_ = 0; + private java.lang.Object recommendationType_; + + public enum RecommendationTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRODUCT_METADATA(10), + RECOMMENDATIONTYPE_NOT_SET(0); + private final int value; + + private RecommendationTypeCase(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 RecommendationTypeCase valueOf(int value) { + return forNumber(value); + } + + public static RecommendationTypeCase forNumber(int value) { + switch (value) { + case 10: + return PRODUCT_METADATA; + case 0: + return RECOMMENDATIONTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RecommendationTypeCase getRecommendationTypeCase() { + return RecommendationTypeCase.forNumber(recommendationTypeCase_); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+   * of 128 bytes.
+   * This id must be unique among all catalog items within the same catalog. It
+   * should also be used when logging user events in order for the user events
+   * to be joined with the Catalog.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+   * of 128 bytes.
+   * This id must be unique among all catalog items within the same catalog. It
+   * should also be used when logging user events in order for the user events
+   * to be joined with the Catalog.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORY_HIERARCHIES_FIELD_NUMBER = 2; + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + categoryHierarchies_; + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getCategoryHierarchiesList() { + return categoryHierarchies_; + } + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + getCategoryHierarchiesOrBuilderList() { + return categoryHierarchies_; + } + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getCategoryHierarchiesCount() { + return categoryHierarchies_.size(); + } + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getCategoryHierarchies(int index) { + return categoryHierarchies_.get(index); + } + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder + getCategoryHierarchiesOrBuilder(int index) { + return categoryHierarchies_.get(index); + } + + public static final int TITLE_FIELD_NUMBER = 3; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+   * KiB.
+   * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+   * KiB.
+   * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. Catalog item description. UTF-8 encoded string with a length
+   * limit of 5 KiB.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Catalog item description. UTF-8 encoded string with a length
+   * limit of 5 KiB.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEM_ATTRIBUTES_FIELD_NUMBER = 5; + private com.google.cloud.recommendationengine.v1beta1.FeatureMap itemAttributes_; + /** + * + * + *
+   * Optional. Highly encouraged. Extra catalog item attributes to be
+   * included in the recommendation model. For example, for retail products,
+   * this could include the store name, vendor, style, color, etc. These are
+   * very strong signals for recommendation model, thus we highly recommend
+   * providing the item attributes here.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the itemAttributes field is set. + */ + public boolean hasItemAttributes() { + return itemAttributes_ != null; + } + /** + * + * + *
+   * Optional. Highly encouraged. Extra catalog item attributes to be
+   * included in the recommendation model. For example, for retail products,
+   * this could include the store name, vendor, style, color, etc. These are
+   * very strong signals for recommendation model, thus we highly recommend
+   * providing the item attributes here.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The itemAttributes. + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getItemAttributes() { + return itemAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : itemAttributes_; + } + /** + * + * + *
+   * Optional. Highly encouraged. Extra catalog item attributes to be
+   * included in the recommendation model. For example, for retail products,
+   * this could include the store name, vendor, style, color, etc. These are
+   * very strong signals for recommendation model, thus we highly recommend
+   * providing the item attributes here.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder + getItemAttributesOrBuilder() { + return getItemAttributes(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Optional. Language of the title/description/item_attributes. Use language
+   * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+   * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+   * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+   * your Google account manager.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Language of the title/description/item_attributes. Use language
+   * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+   * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+   * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+   * your Google account manager.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAGS_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList tags_; + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int ITEM_GROUP_ID_FIELD_NUMBER = 9; + private volatile java.lang.Object itemGroupId_; + /** + * + * + *
+   * Optional. Variant group identifier for prediction results. UTF-8 encoded
+   * string with a length limit of 128 bytes.
+   * This field must be enabled before it can be used. [Learn
+   * more](/recommendations-ai/docs/catalog#item-group-id).
+   * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The itemGroupId. + */ + public java.lang.String getItemGroupId() { + java.lang.Object ref = itemGroupId_; + 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(); + itemGroupId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Variant group identifier for prediction results. UTF-8 encoded
+   * string with a length limit of 128 bytes.
+   * This field must be enabled before it can be used. [Learn
+   * more](/recommendations-ai/docs/catalog#item-group-id).
+   * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for itemGroupId. + */ + public com.google.protobuf.ByteString getItemGroupIdBytes() { + java.lang.Object ref = itemGroupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + itemGroupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_METADATA_FIELD_NUMBER = 10; + /** + * + * + *
+   * Optional. Metadata specific to retail products.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the productMetadata field is set. + */ + public boolean hasProductMetadata() { + return recommendationTypeCase_ == 10; + } + /** + * + * + *
+   * Optional. Metadata specific to retail products.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The productMetadata. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem getProductMetadata() { + if (recommendationTypeCase_ == 10) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) recommendationType_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Metadata specific to retail products.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder + getProductMetadataOrBuilder() { + if (recommendationTypeCase_ == 10) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) recommendationType_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + for (int i = 0; i < categoryHierarchies_.size(); i++) { + output.writeMessage(2, categoryHierarchies_.get(i)); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, title_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); + } + if (itemAttributes_ != null) { + output.writeMessage(5, getItemAttributes()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, tags_.getRaw(i)); + } + if (!getItemGroupIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, itemGroupId_); + } + if (recommendationTypeCase_ == 10) { + output.writeMessage( + 10, + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) recommendationType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + for (int i = 0; i < categoryHierarchies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, categoryHierarchies_.get(i)); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, title_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); + } + if (itemAttributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getItemAttributes()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (!getItemGroupIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, itemGroupId_); + } + if (recommendationTypeCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_); + } + 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.recommendationengine.v1beta1.CatalogItem)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.CatalogItem other = + (com.google.cloud.recommendationengine.v1beta1.CatalogItem) obj; + + if (!getId().equals(other.getId())) return false; + if (!getCategoryHierarchiesList().equals(other.getCategoryHierarchiesList())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasItemAttributes() != other.hasItemAttributes()) return false; + if (hasItemAttributes()) { + if (!getItemAttributes().equals(other.getItemAttributes())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (!getItemGroupId().equals(other.getItemGroupId())) return false; + if (!getRecommendationTypeCase().equals(other.getRecommendationTypeCase())) return false; + switch (recommendationTypeCase_) { + case 10: + if (!getProductMetadata().equals(other.getProductMetadata())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (getCategoryHierarchiesCount() > 0) { + hash = (37 * hash) + CATEGORY_HIERARCHIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoryHierarchiesList().hashCode(); + } + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasItemAttributes()) { + hash = (37 * hash) + ITEM_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getItemAttributes().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + hash = (37 * hash) + ITEM_GROUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getItemGroupId().hashCode(); + switch (recommendationTypeCase_) { + case 10: + hash = (37 * hash) + PRODUCT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getProductMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem 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.recommendationengine.v1beta1.CatalogItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem 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.recommendationengine.v1beta1.CatalogItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem 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.recommendationengine.v1beta1.CatalogItem parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem 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.recommendationengine.v1beta1.CatalogItem parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem 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.recommendationengine.v1beta1.CatalogItem 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; + } + /** + * + * + *
+   * CatalogItem captures all metadata information of items to be recommended.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CatalogItem} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.CatalogItem) + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.class, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.CatalogItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCategoryHierarchiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + if (categoryHierarchiesBuilder_ == null) { + categoryHierarchies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + categoryHierarchiesBuilder_.clear(); + } + title_ = ""; + + description_ = ""; + + if (itemAttributesBuilder_ == null) { + itemAttributes_ = null; + } else { + itemAttributes_ = null; + itemAttributesBuilder_ = null; + } + languageCode_ = ""; + + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + itemGroupId_ = ""; + + recommendationTypeCase_ = 0; + recommendationType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_CatalogItem_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogItem build() { + com.google.cloud.recommendationengine.v1beta1.CatalogItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CatalogItem buildPartial() { + com.google.cloud.recommendationengine.v1beta1.CatalogItem result = + new com.google.cloud.recommendationengine.v1beta1.CatalogItem(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + if (categoryHierarchiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + categoryHierarchies_ = java.util.Collections.unmodifiableList(categoryHierarchies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.categoryHierarchies_ = categoryHierarchies_; + } else { + result.categoryHierarchies_ = categoryHierarchiesBuilder_.build(); + } + result.title_ = title_; + result.description_ = description_; + if (itemAttributesBuilder_ == null) { + result.itemAttributes_ = itemAttributes_; + } else { + result.itemAttributes_ = itemAttributesBuilder_.build(); + } + result.languageCode_ = languageCode_; + if (((bitField0_ & 0x00000002) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.tags_ = tags_; + result.itemGroupId_ = itemGroupId_; + if (recommendationTypeCase_ == 10) { + if (productMetadataBuilder_ == null) { + result.recommendationType_ = recommendationType_; + } else { + result.recommendationType_ = productMetadataBuilder_.build(); + } + } + result.recommendationTypeCase_ = recommendationTypeCase_; + 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.recommendationengine.v1beta1.CatalogItem) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.CatalogItem) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.CatalogItem other) { + if (other == com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (categoryHierarchiesBuilder_ == null) { + if (!other.categoryHierarchies_.isEmpty()) { + if (categoryHierarchies_.isEmpty()) { + categoryHierarchies_ = other.categoryHierarchies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.addAll(other.categoryHierarchies_); + } + onChanged(); + } + } else { + if (!other.categoryHierarchies_.isEmpty()) { + if (categoryHierarchiesBuilder_.isEmpty()) { + categoryHierarchiesBuilder_.dispose(); + categoryHierarchiesBuilder_ = null; + categoryHierarchies_ = other.categoryHierarchies_; + bitField0_ = (bitField0_ & ~0x00000001); + categoryHierarchiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCategoryHierarchiesFieldBuilder() + : null; + } else { + categoryHierarchiesBuilder_.addAllMessages(other.categoryHierarchies_); + } + } + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasItemAttributes()) { + mergeItemAttributes(other.getItemAttributes()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (!other.getItemGroupId().isEmpty()) { + itemGroupId_ = other.itemGroupId_; + onChanged(); + } + switch (other.getRecommendationTypeCase()) { + case PRODUCT_METADATA: + { + mergeProductMetadata(other.getProductMetadata()); + break; + } + case RECOMMENDATIONTYPE_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.recommendationengine.v1beta1.CatalogItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.CatalogItem) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int recommendationTypeCase_ = 0; + private java.lang.Object recommendationType_; + + public RecommendationTypeCase getRecommendationTypeCase() { + return RecommendationTypeCase.forNumber(recommendationTypeCase_); + } + + public Builder clearRecommendationType() { + recommendationTypeCase_ = 0; + recommendationType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+     * of 128 bytes.
+     * This id must be unique among all catalog items within the same catalog. It
+     * should also be used when logging user events in order for the user events
+     * to be joined with the Catalog.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+     * of 128 bytes.
+     * This id must be unique among all catalog items within the same catalog. It
+     * should also be used when logging user events in order for the user events
+     * to be joined with the Catalog.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+     * of 128 bytes.
+     * This id must be unique among all catalog items within the same catalog. It
+     * should also be used when logging user events in order for the user events
+     * to be joined with the Catalog.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+     * of 128 bytes.
+     * This id must be unique among all catalog items within the same catalog. It
+     * should also be used when logging user events in order for the user events
+     * to be joined with the Catalog.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+     * of 128 bytes.
+     * This id must be unique among all catalog items within the same catalog. It
+     * should also be used when logging user events in order for the user events
+     * to be joined with the Catalog.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + categoryHierarchies_ = java.util.Collections.emptyList(); + + private void ensureCategoryHierarchiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + categoryHierarchies_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy>( + categoryHierarchies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + categoryHierarchiesBuilder_; + + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + getCategoryHierarchiesList() { + if (categoryHierarchiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(categoryHierarchies_); + } else { + return categoryHierarchiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getCategoryHierarchiesCount() { + if (categoryHierarchiesBuilder_ == null) { + return categoryHierarchies_.size(); + } else { + return categoryHierarchiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getCategoryHierarchies(int index) { + if (categoryHierarchiesBuilder_ == null) { + return categoryHierarchies_.get(index); + } else { + return categoryHierarchiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCategoryHierarchies( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { + if (categoryHierarchiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.set(index, value); + onChanged(); + } else { + categoryHierarchiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCategoryHierarchies( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + builderForValue) { + if (categoryHierarchiesBuilder_ == null) { + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.set(index, builderForValue.build()); + onChanged(); + } else { + categoryHierarchiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCategoryHierarchies( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { + if (categoryHierarchiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.add(value); + onChanged(); + } else { + categoryHierarchiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCategoryHierarchies( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { + if (categoryHierarchiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.add(index, value); + onChanged(); + } else { + categoryHierarchiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCategoryHierarchies( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + builderForValue) { + if (categoryHierarchiesBuilder_ == null) { + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.add(builderForValue.build()); + onChanged(); + } else { + categoryHierarchiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addCategoryHierarchies( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + builderForValue) { + if (categoryHierarchiesBuilder_ == null) { + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.add(index, builderForValue.build()); + onChanged(); + } else { + categoryHierarchiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllCategoryHierarchies( + java.lang.Iterable< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + values) { + if (categoryHierarchiesBuilder_ == null) { + ensureCategoryHierarchiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categoryHierarchies_); + onChanged(); + } else { + categoryHierarchiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCategoryHierarchies() { + if (categoryHierarchiesBuilder_ == null) { + categoryHierarchies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + categoryHierarchiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeCategoryHierarchies(int index) { + if (categoryHierarchiesBuilder_ == null) { + ensureCategoryHierarchiesIsMutable(); + categoryHierarchies_.remove(index); + onChanged(); + } else { + categoryHierarchiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + getCategoryHierarchiesBuilder(int index) { + return getCategoryHierarchiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder + getCategoryHierarchiesOrBuilder(int index) { + if (categoryHierarchiesBuilder_ == null) { + return categoryHierarchies_.get(index); + } else { + return categoryHierarchiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .CategoryHierarchyOrBuilder> + getCategoryHierarchiesOrBuilderList() { + if (categoryHierarchiesBuilder_ != null) { + return categoryHierarchiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(categoryHierarchies_); + } + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + addCategoryHierarchiesBuilder() { + return getCategoryHierarchiesFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .getDefaultInstance()); + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + addCategoryHierarchiesBuilder(int index) { + return getCategoryHierarchiesFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .getDefaultInstance()); + } + /** + * + * + *
+     * Required. Catalog item categories. This field is repeated for supporting
+     * one catalog item belonging to several parallel category hierarchies.
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categoryHierarchies": [
+     *        { "categories": ["Shoes & Accessories", "Shoes"]},
+     *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+     *      ]
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder> + getCategoryHierarchiesBuilderList() { + return getCategoryHierarchiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + getCategoryHierarchiesFieldBuilder() { + if (categoryHierarchiesBuilder_ == null) { + categoryHierarchiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .CategoryHierarchyOrBuilder>( + categoryHierarchies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + categoryHierarchies_ = null; + } + return categoryHierarchiesBuilder_; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+     * KiB.
+     * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+     * KiB.
+     * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+     * KiB.
+     * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+     * KiB.
+     * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+     * KiB.
+     * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Catalog item description. UTF-8 encoded string with a length
+     * limit of 5 KiB.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Catalog item description. UTF-8 encoded string with a length
+     * limit of 5 KiB.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Catalog item description. UTF-8 encoded string with a length
+     * limit of 5 KiB.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Catalog item description. UTF-8 encoded string with a length
+     * limit of 5 KiB.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Catalog item description. UTF-8 encoded string with a length
+     * limit of 5 KiB.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.FeatureMap itemAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder> + itemAttributesBuilder_; + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the itemAttributes field is set. + */ + public boolean hasItemAttributes() { + return itemAttributesBuilder_ != null || itemAttributes_ != null; + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The itemAttributes. + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getItemAttributes() { + if (itemAttributesBuilder_ == null) { + return itemAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : itemAttributes_; + } else { + return itemAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setItemAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap value) { + if (itemAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + itemAttributes_ = value; + onChanged(); + } else { + itemAttributesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setItemAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder builderForValue) { + if (itemAttributesBuilder_ == null) { + itemAttributes_ = builderForValue.build(); + onChanged(); + } else { + itemAttributesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeItemAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap value) { + if (itemAttributesBuilder_ == null) { + if (itemAttributes_ != null) { + itemAttributes_ = + com.google.cloud.recommendationengine.v1beta1.FeatureMap.newBuilder(itemAttributes_) + .mergeFrom(value) + .buildPartial(); + } else { + itemAttributes_ = value; + } + onChanged(); + } else { + itemAttributesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearItemAttributes() { + if (itemAttributesBuilder_ == null) { + itemAttributes_ = null; + onChanged(); + } else { + itemAttributes_ = null; + itemAttributesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder + getItemAttributesBuilder() { + + onChanged(); + return getItemAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder + getItemAttributesOrBuilder() { + if (itemAttributesBuilder_ != null) { + return itemAttributesBuilder_.getMessageOrBuilder(); + } else { + return itemAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : itemAttributes_; + } + } + /** + * + * + *
+     * Optional. Highly encouraged. Extra catalog item attributes to be
+     * included in the recommendation model. For example, for retail products,
+     * this could include the store name, vendor, style, color, etc. These are
+     * very strong signals for recommendation model, thus we highly recommend
+     * providing the item attributes here.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder> + getItemAttributesFieldBuilder() { + if (itemAttributesBuilder_ == null) { + itemAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder>( + getItemAttributes(), getParentForChildren(), isClean()); + itemAttributes_ = null; + } + return itemAttributesBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Optional. Language of the title/description/item_attributes. Use language
+     * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+     * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+     * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+     * your Google account manager.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Language of the title/description/item_attributes. Use language
+     * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+     * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+     * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+     * your Google account manager.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Language of the title/description/item_attributes. Use language
+     * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+     * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+     * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+     * your Google account manager.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Language of the title/description/item_attributes. Use language
+     * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+     * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+     * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+     * your Google account manager.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Language of the title/description/item_attributes. Use language
+     * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+     * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+     * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+     * your Google account manager.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering tags associated with the catalog item. Each tag should
+     * be a UTF-8 encoded string with a length limit of 1 KiB.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the predict request filter.
+     * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private java.lang.Object itemGroupId_ = ""; + /** + * + * + *
+     * Optional. Variant group identifier for prediction results. UTF-8 encoded
+     * string with a length limit of 128 bytes.
+     * This field must be enabled before it can be used. [Learn
+     * more](/recommendations-ai/docs/catalog#item-group-id).
+     * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The itemGroupId. + */ + public java.lang.String getItemGroupId() { + java.lang.Object ref = itemGroupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + itemGroupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Variant group identifier for prediction results. UTF-8 encoded
+     * string with a length limit of 128 bytes.
+     * This field must be enabled before it can be used. [Learn
+     * more](/recommendations-ai/docs/catalog#item-group-id).
+     * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for itemGroupId. + */ + public com.google.protobuf.ByteString getItemGroupIdBytes() { + java.lang.Object ref = itemGroupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + itemGroupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Variant group identifier for prediction results. UTF-8 encoded
+     * string with a length limit of 128 bytes.
+     * This field must be enabled before it can be used. [Learn
+     * more](/recommendations-ai/docs/catalog#item-group-id).
+     * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The itemGroupId to set. + * @return This builder for chaining. + */ + public Builder setItemGroupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + itemGroupId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Variant group identifier for prediction results. UTF-8 encoded
+     * string with a length limit of 128 bytes.
+     * This field must be enabled before it can be used. [Learn
+     * more](/recommendations-ai/docs/catalog#item-group-id).
+     * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearItemGroupId() { + + itemGroupId_ = getDefaultInstance().getItemGroupId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Variant group identifier for prediction results. UTF-8 encoded
+     * string with a length limit of 128 bytes.
+     * This field must be enabled before it can be used. [Learn
+     * more](/recommendations-ai/docs/catalog#item-group-id).
+     * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for itemGroupId to set. + * @return This builder for chaining. + */ + public Builder setItemGroupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + itemGroupId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder> + productMetadataBuilder_; + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the productMetadata field is set. + */ + public boolean hasProductMetadata() { + return recommendationTypeCase_ == 10; + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The productMetadata. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem getProductMetadata() { + if (productMetadataBuilder_ == null) { + if (recommendationTypeCase_ == 10) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + .getDefaultInstance(); + } else { + if (recommendationTypeCase_ == 10) { + return productMetadataBuilder_.getMessage(); + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setProductMetadata( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem value) { + if (productMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recommendationType_ = value; + onChanged(); + } else { + productMetadataBuilder_.setMessage(value); + } + recommendationTypeCase_ = 10; + return this; + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setProductMetadata( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder builderForValue) { + if (productMetadataBuilder_ == null) { + recommendationType_ = builderForValue.build(); + onChanged(); + } else { + productMetadataBuilder_.setMessage(builderForValue.build()); + } + recommendationTypeCase_ = 10; + return this; + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeProductMetadata( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem value) { + if (productMetadataBuilder_ == null) { + if (recommendationTypeCase_ == 10 + && recommendationType_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + .getDefaultInstance()) { + recommendationType_ = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.newBuilder( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_) + .mergeFrom(value) + .buildPartial(); + } else { + recommendationType_ = value; + } + onChanged(); + } else { + if (recommendationTypeCase_ == 10) { + productMetadataBuilder_.mergeFrom(value); + } + productMetadataBuilder_.setMessage(value); + } + recommendationTypeCase_ = 10; + return this; + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearProductMetadata() { + if (productMetadataBuilder_ == null) { + if (recommendationTypeCase_ == 10) { + recommendationTypeCase_ = 0; + recommendationType_ = null; + onChanged(); + } + } else { + if (recommendationTypeCase_ == 10) { + recommendationTypeCase_ = 0; + recommendationType_ = null; + } + productMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder + getProductMetadataBuilder() { + return getProductMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder + getProductMetadataOrBuilder() { + if ((recommendationTypeCase_ == 10) && (productMetadataBuilder_ != null)) { + return productMetadataBuilder_.getMessageOrBuilder(); + } else { + if (recommendationTypeCase_ == 10) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Metadata specific to retail products.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder> + getProductMetadataFieldBuilder() { + if (productMetadataBuilder_ == null) { + if (!(recommendationTypeCase_ == 10)) { + recommendationType_ = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.getDefaultInstance(); + } + productMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder>( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + recommendationType_, + getParentForChildren(), + isClean()); + recommendationType_ = null; + } + recommendationTypeCase_ = 10; + onChanged(); + ; + return productMetadataBuilder_; + } + + @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.recommendationengine.v1beta1.CatalogItem) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.CatalogItem) + private static final com.google.cloud.recommendationengine.v1beta1.CatalogItem DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.CatalogItem(); + } + + public static com.google.cloud.recommendationengine.v1beta1.CatalogItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CatalogItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CatalogItem(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.recommendationengine.v1beta1.CatalogItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItemOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItemOrBuilder.java new file mode 100644 index 00000000..b644ff8d --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItemOrBuilder.java @@ -0,0 +1,449 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface CatalogItemOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.CatalogItem) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+   * of 128 bytes.
+   * This id must be unique among all catalog items within the same catalog. It
+   * should also be used when logging user events in order for the user events
+   * to be joined with the Catalog.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Required. Catalog item identifier. UTF-8 encoded string with a length limit
+   * of 128 bytes.
+   * This id must be unique among all catalog items within the same catalog. It
+   * should also be used when logging user events in order for the user events
+   * to be joined with the Catalog.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getCategoryHierarchiesList(); + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getCategoryHierarchies(int index); + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getCategoryHierarchiesCount(); + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + getCategoryHierarchiesOrBuilderList(); + /** + * + * + *
+   * Required. Catalog item categories. This field is repeated for supporting
+   * one catalog item belonging to several parallel category hierarchies.
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categoryHierarchies": [
+   *        { "categories": ["Shoes & Accessories", "Shoes"]},
+   *        { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] }
+   *      ]
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder + getCategoryHierarchiesOrBuilder(int index); + + /** + * + * + *
+   * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+   * KiB.
+   * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Required. Catalog item title. UTF-8 encoded string with a length limit of 1
+   * KiB.
+   * 
+ * + * string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Optional. Catalog item description. UTF-8 encoded string with a length
+   * limit of 5 KiB.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Catalog item description. UTF-8 encoded string with a length
+   * limit of 5 KiB.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. Highly encouraged. Extra catalog item attributes to be
+   * included in the recommendation model. For example, for retail products,
+   * this could include the store name, vendor, style, color, etc. These are
+   * very strong signals for recommendation model, thus we highly recommend
+   * providing the item attributes here.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the itemAttributes field is set. + */ + boolean hasItemAttributes(); + /** + * + * + *
+   * Optional. Highly encouraged. Extra catalog item attributes to be
+   * included in the recommendation model. For example, for retail products,
+   * this could include the store name, vendor, style, color, etc. These are
+   * very strong signals for recommendation model, thus we highly recommend
+   * providing the item attributes here.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The itemAttributes. + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap getItemAttributes(); + /** + * + * + *
+   * Optional. Highly encouraged. Extra catalog item attributes to be
+   * included in the recommendation model. For example, for retail products,
+   * this could include the store name, vendor, style, color, etc. These are
+   * very strong signals for recommendation model, thus we highly recommend
+   * providing the item attributes here.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder getItemAttributesOrBuilder(); + + /** + * + * + *
+   * Optional. Language of the title/description/item_attributes. Use language
+   * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+   * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+   * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+   * your Google account manager.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Optional. Language of the title/description/item_attributes. Use language
+   * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our
+   * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh',
+   * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact
+   * your Google account manager.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+   * Optional. Filtering tags associated with the catalog item. Each tag should
+   * be a UTF-8 encoded string with a length limit of 1 KiB.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the predict request filter.
+   * 
+ * + * repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+   * Optional. Variant group identifier for prediction results. UTF-8 encoded
+   * string with a length limit of 128 bytes.
+   * This field must be enabled before it can be used. [Learn
+   * more](/recommendations-ai/docs/catalog#item-group-id).
+   * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The itemGroupId. + */ + java.lang.String getItemGroupId(); + /** + * + * + *
+   * Optional. Variant group identifier for prediction results. UTF-8 encoded
+   * string with a length limit of 128 bytes.
+   * This field must be enabled before it can be used. [Learn
+   * more](/recommendations-ai/docs/catalog#item-group-id).
+   * 
+ * + * string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for itemGroupId. + */ + com.google.protobuf.ByteString getItemGroupIdBytes(); + + /** + * + * + *
+   * Optional. Metadata specific to retail products.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the productMetadata field is set. + */ + boolean hasProductMetadata(); + /** + * + * + *
+   * Optional. Metadata specific to retail products.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The productMetadata. + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem getProductMetadata(); + /** + * + * + *
+   * Optional. Metadata specific to retail products.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder + getProductMetadataOrBuilder(); + + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.RecommendationTypeCase + getRecommendationTypeCase(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItemPathName.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItemPathName.java new file mode 100644 index 00000000..b2fe0700 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogItemPathName.java @@ -0,0 +1,251 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class CatalogItemPathName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path=**}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String catalog; + private final String catalogItemPath; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getCatalogItemPath() { + return catalogItemPath; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private CatalogItemPathName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + catalogItemPath = Preconditions.checkNotNull(builder.getCatalogItemPath()); + } + + public static CatalogItemPathName of( + String project, String location, String catalog, String catalogItemPath) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setCatalogItemPath(catalogItemPath) + .build(); + } + + public static String format( + String project, String location, String catalog, String catalogItemPath) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setCatalogItemPath(catalogItemPath) + .build() + .toString(); + } + + public static CatalogItemPathName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "CatalogItemPathName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("catalog_item_path")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (CatalogItemPathName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("catalog", catalog); + fieldMapBuilder.put("catalogItemPath", catalogItemPath); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "catalog_item_path", + catalogItemPath); + } + + /** Builder for CatalogItemPathName. */ + public static class Builder { + + private String project; + private String location; + private String catalog; + private String catalogItemPath; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getCatalogItemPath() { + return catalogItemPath; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public Builder setCatalogItemPath(String catalogItemPath) { + this.catalogItemPath = catalogItemPath; + return this; + } + + private Builder() {} + + private Builder(CatalogItemPathName catalogItemPathName) { + project = catalogItemPathName.project; + location = catalogItemPathName.location; + catalog = catalogItemPathName.catalog; + catalogItemPath = catalogItemPathName.catalogItemPath; + } + + public CatalogItemPathName build() { + return new CatalogItemPathName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CatalogItemPathName) { + CatalogItemPathName that = (CatalogItemPathName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.catalog.equals(that.catalog)) + && (this.catalogItemPath.equals(that.catalogItemPath)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= catalog.hashCode(); + h *= 1000003; + h ^= catalogItemPath.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogName.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogName.java new file mode 100644 index 00000000..360f480a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogName.java @@ -0,0 +1,210 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class CatalogName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String catalog; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private CatalogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public static CatalogName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static CatalogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "CatalogName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (CatalogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("catalog", catalog); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location, "catalog", catalog); + } + + /** Builder for CatalogName. */ + public static class Builder { + + private String project; + private String location; + private String catalog; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + private Builder() {} + + private Builder(CatalogName catalogName) { + project = catalogName.project; + location = catalogName.location; + catalog = catalogName.catalog; + } + + public CatalogName build() { + return new CatalogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CatalogName) { + CatalogName that = (CatalogName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.catalog.equals(that.catalog)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= catalog.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceOuterClass.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceOuterClass.java new file mode 100644 index 00000000..67be8634 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceOuterClass.java @@ -0,0 +1,218 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class CatalogServiceOuterClass { + private CatalogServiceOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/cloud/recommendationengine/v1be" + + "ta1/catalog_service.proto\022)google.cloud." + + "recommendationengine.v1beta1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\0327go" + + "ogle/cloud/recommendationengine/v1beta1/" + + "catalog.proto\0326google/cloud/recommendati" + + "onengine/v1beta1/import.proto\032#google/lo" + + "ngrunning/operations.proto\032\033google/proto" + + "buf/empty.proto\032 google/protobuf/field_m" + + "ask.proto\"\202\001\n\030CreateCatalogItemRequest\022\023" + + "\n\006parent\030\001 \001(\tB\003\340A\002\022Q\n\014catalog_item\030\002 \001(" + + "\01326.google.cloud.recommendationengine.v1" + + "beta1.CatalogItemB\003\340A\002\"*\n\025GetCatalogItem" + + "Request\022\021\n\004name\030\001 \001(\tB\003\340A\002\"t\n\027ListCatalo" + + "gItemsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\026\n\tpa" + + "ge_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003" + + "\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\"\202\001\n\030ListCatalog" + + "ItemsResponse\022M\n\rcatalog_items\030\001 \003(\01326.g" + + "oogle.cloud.recommendationengine.v1beta1" + + ".CatalogItem\022\027\n\017next_page_token\030\002 \001(\t\"\266\001" + + "\n\030UpdateCatalogItemRequest\022\021\n\004name\030\001 \001(\t" + + "B\003\340A\002\022Q\n\014catalog_item\030\002 \001(\01326.google.clo" + + "ud.recommendationengine.v1beta1.CatalogI" + + "temB\003\340A\002\0224\n\013update_mask\030\003 \001(\0132\032.google.p" + + "rotobuf.FieldMaskB\003\340A\001\"-\n\030DeleteCatalogI" + + "temRequest\022\021\n\004name\030\001 \001(\tB\003\340A\0022\274\014\n\016Catalo" + + "gService\022\350\001\n\021CreateCatalogItem\022C.google." + + "cloud.recommendationengine.v1beta1.Creat" + + "eCatalogItemRequest\0326.google.cloud.recom" + + "mendationengine.v1beta1.CatalogItem\"V\202\323\344" + + "\223\002P\"@/v1beta1/{parent=projects/*/locatio" + + "ns/*/catalogs/*}/catalogItems:\014catalog_i" + + "tem\022\334\001\n\016GetCatalogItem\022@.google.cloud.re" + + "commendationengine.v1beta1.GetCatalogIte" + + "mRequest\0326.google.cloud.recommendationen" + + "gine.v1beta1.CatalogItem\"P\202\323\344\223\002C\022A/v1bet" + + "a1/{name=projects/*/locations/*/catalogs" + + "/*/catalogItems/**}\332A\004name\022\345\001\n\020ListCatal" + + "ogItems\022B.google.cloud.recommendationeng" + + "ine.v1beta1.ListCatalogItemsRequest\032C.go" + + "ogle.cloud.recommendationengine.v1beta1." + + "ListCatalogItemsResponse\"H\202\323\344\223\002B\022@/v1bet" + + "a1/{parent=projects/*/locations/*/catalo" + + "gs/*}/catalogItems\022\204\002\n\021UpdateCatalogItem" + + "\022C.google.cloud.recommendationengine.v1b" + + "eta1.UpdateCatalogItemRequest\0326.google.c" + + "loud.recommendationengine.v1beta1.Catalo" + + "gItem\"r\202\323\344\223\002Q2A/v1beta1/{name=projects/*" + + "/locations/*/catalogs/*/catalogItems/**}" + + ":\014catalog_item\332A\030catalog_item,update_mas" + + "k\022\302\001\n\021DeleteCatalogItem\022C.google.cloud.r" + + "ecommendationengine.v1beta1.DeleteCatalo" + + "gItemRequest\032\026.google.protobuf.Empty\"P\202\323" + + "\344\223\002C*A/v1beta1/{name=projects/*/location" + + "s/*/catalogs/*/catalogItems/**}\332A\004name\022\322" + + "\002\n\022ImportCatalogItems\022D.google.cloud.rec" + + "ommendationengine.v1beta1.ImportCatalogI" + + "temsRequest\032\035.google.longrunning.Operati" + + "on\"\326\001\202\323\344\223\002L\"G/v1beta1/{parent=projects/*" + + "/locations/*/catalogs/*}/catalogItems:im" + + "port:\001*\312A\200\001\nDgoogle.cloud.recommendation" + + "engine.v1beta1.ImportCatalogItemsRespons" + + "e\0228google.cloud.recommendationengine.v1b" + + "eta1.ImportMetadata\032W\312A#recommendationen" + + "gine.googleapis.com\322A.https://www.google" + + "apis.com/auth/cloud-platformB\304\001\n-com.goo" + + "gle.cloud.recommendationengine.v1beta1P\001" + + "Z]google.golang.org/genproto/googleapis/" + + "cloud/recommendationengine/v1beta1;recom" + + "mendationengine\242\002\005RECAI\252\002)Google.Cloud.R" + + "ecommendationEngine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Catalog.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Import.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_descriptor, + new java.lang.String[] { + "Parent", "CatalogItem", + }); + internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_descriptor, + new java.lang.String[] { + "CatalogItems", "NextPageToken", + }); + internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_descriptor, + new java.lang.String[] { + "Name", "CatalogItem", "UpdateMask", + }); + internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Catalog.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Import.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CollectUserEventRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CollectUserEventRequest.java new file mode 100644 index 00000000..4dad1cc9 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CollectUserEventRequest.java @@ -0,0 +1,1124 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for CollectUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CollectUserEventRequest} + */ +public final class CollectUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) + CollectUserEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CollectUserEventRequest.newBuilder() to construct. + private CollectUserEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CollectUserEventRequest() { + parent_ = ""; + userEvent_ = ""; + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CollectUserEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CollectUserEventRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + userEvent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 32: + { + ets_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.class, + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent eventStore name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent eventStore name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_EVENT_FIELD_NUMBER = 2; + private volatile java.lang.Object userEvent_; + /** + * + * + *
+   * Required. URL encoded UserEvent proto.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + public java.lang.String getUserEvent() { + java.lang.Object ref = userEvent_; + 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(); + userEvent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URL encoded UserEvent proto.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + public com.google.protobuf.ByteString getUserEventBytes() { + java.lang.Object ref = userEvent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 3; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+   * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+   * This is often more useful than the referer url, because many browsers only
+   * send the domain for 3rd party requests.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+   * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+   * This is often more useful than the referer url, because many browsers only
+   * send the domain for 3rd party requests.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETS_FIELD_NUMBER = 4; + private long ets_; + /** + * + * + *
+   * Optional. The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ets. + */ + public long getEts() { + return ets_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getUserEventBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userEvent_); + } + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (ets_ != 0L) { + output.writeInt64(4, ets_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getUserEventBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userEvent_); + } + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (ets_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ets_); + } + 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.recommendationengine.v1beta1.CollectUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest other = + (com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserEvent().equals(other.getUserEvent())) return false; + if (!getUri().equals(other.getUri())) return false; + if (getEts() != other.getEts()) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + ETS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEts()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest 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.recommendationengine.v1beta1.CollectUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest 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.recommendationengine.v1beta1.CollectUserEventRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest 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.recommendationengine.v1beta1.CollectUserEventRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + 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.recommendationengine.v1beta1.CollectUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest 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.recommendationengine.v1beta1.CollectUserEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for CollectUserEvent method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CollectUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.class, + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.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(); + parent_ = ""; + + userEvent_ = ""; + + uri_ = ""; + + ets_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest build() { + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest result = + new com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest(this); + result.parent_ = parent_; + result.userEvent_ = userEvent_; + result.uri_ = uri_; + result.ets_ = ets_; + 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.recommendationengine.v1beta1.CollectUserEventRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getUserEvent().isEmpty()) { + userEvent_ = other.userEvent_; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getEts() != 0L) { + setEts(other.getEts()); + } + 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.recommendationengine.v1beta1.CollectUserEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent eventStore name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent eventStore name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent eventStore name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent eventStore name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent eventStore name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object userEvent_ = ""; + /** + * + * + *
+     * Required. URL encoded UserEvent proto.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + public java.lang.String getUserEvent() { + java.lang.Object ref = userEvent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userEvent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + public com.google.protobuf.ByteString getUserEventBytes() { + java.lang.Object ref = userEvent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userEvent to set. + * @return This builder for chaining. + */ + public Builder setUserEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userEvent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserEvent() { + + userEvent_ = getDefaultInstance().getUserEvent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userEvent to set. + * @return This builder for chaining. + */ + public Builder setUserEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userEvent_ = value; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+     * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+     * This is often more useful than the referer url, because many browsers only
+     * send the domain for 3rd party requests.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+     * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+     * This is often more useful than the referer url, because many browsers only
+     * send the domain for 3rd party requests.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+     * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+     * This is often more useful than the referer url, because many browsers only
+     * send the domain for 3rd party requests.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+     * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+     * This is often more useful than the referer url, because many browsers only
+     * send the domain for 3rd party requests.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+     * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+     * This is often more useful than the referer url, because many browsers only
+     * send the domain for 3rd party requests.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private long ets_; + /** + * + * + *
+     * Optional. The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ets. + */ + public long getEts() { + return ets_; + } + /** + * + * + *
+     * Optional. The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ets to set. + * @return This builder for chaining. + */ + public Builder setEts(long value) { + + ets_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEts() { + + ets_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) + private static final com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CollectUserEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CollectUserEventRequest(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.recommendationengine.v1beta1.CollectUserEventRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CollectUserEventRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CollectUserEventRequestOrBuilder.java new file mode 100644 index 00000000..59cb9e0c --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CollectUserEventRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface CollectUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.CollectUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent eventStore name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent eventStore name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. URL encoded UserEvent proto.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + java.lang.String getUserEvent(); + /** + * + * + *
+   * Required. URL encoded UserEvent proto.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + com.google.protobuf.ByteString getUserEventBytes(); + + /** + * + * + *
+   * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+   * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+   * This is often more useful than the referer url, because many browsers only
+   * send the domain for 3rd party requests.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+   * must be truncated to 1.5K bytes to conservatively be under the 2K bytes.
+   * This is often more useful than the referer url, because many browsers only
+   * send the domain for 3rd party requests.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Optional. The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ets. + */ + long getEts(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Common.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Common.java new file mode 100644 index 00000000..9a03ce10 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Common.java @@ -0,0 +1,140 @@ +/* + * 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/recommendationengine/v1beta1/common.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class Common { + private Common() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_CategoricalFeaturesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_CategoricalFeaturesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_NumericalFeaturesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_NumericalFeaturesEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/recommendationengine/v1be" + + "ta1/common.proto\022)google.cloud.recommend" + + "ationengine.v1beta1\032\034google/api/annotati" + + "ons.proto\"\226\004\n\nFeatureMap\022l\n\024categorical_" + + "features\030\001 \003(\0132N.google.cloud.recommenda" + + "tionengine.v1beta1.FeatureMap.Categorica" + + "lFeaturesEntry\022h\n\022numerical_features\030\002 \003" + + "(\0132L.google.cloud.recommendationengine.v" + + "1beta1.FeatureMap.NumericalFeaturesEntry" + + "\032\033\n\nStringList\022\r\n\005value\030\001 \003(\t\032\032\n\tFloatLi" + + "st\022\r\n\005value\030\001 \003(\002\032|\n\030CategoricalFeatures" + + "Entry\022\013\n\003key\030\001 \001(\t\022O\n\005value\030\002 \001(\0132@.goog" + + "le.cloud.recommendationengine.v1beta1.Fe" + + "atureMap.StringList:\0028\001\032y\n\026NumericalFeat" + + "uresEntry\022\013\n\003key\030\001 \001(\t\022N\n\005value\030\002 \001(\0132?." + + "google.cloud.recommendationengine.v1beta" + + "1.FeatureMap.FloatList:\0028\001B\304\001\n-com.googl" + + "e.cloud.recommendationengine.v1beta1P\001Z]" + + "google.golang.org/genproto/googleapis/cl" + + "oud/recommendationengine/v1beta1;recomme" + + "ndationengine\242\002\005RECAI\252\002)Google.Cloud.Rec" + + "ommendationEngine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor, + new java.lang.String[] { + "CategoricalFeatures", "NumericalFeatures", + }); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_descriptor, + new java.lang.String[] { + "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_descriptor, + new java.lang.String[] { + "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_CategoricalFeaturesEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_CategoricalFeaturesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_CategoricalFeaturesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_NumericalFeaturesEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_NumericalFeaturesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_NumericalFeaturesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreateCatalogItemRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreateCatalogItemRequest.java new file mode 100644 index 00000000..c3f89260 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreateCatalogItemRequest.java @@ -0,0 +1,958 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for CreateCatalogItem method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest} + */ +public final class CreateCatalogItemRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) + CreateCatalogItemRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateCatalogItemRequest.newBuilder() to construct. + private CreateCatalogItemRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateCatalogItemRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateCatalogItemRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateCatalogItemRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder subBuilder = null; + if (catalogItem_ != null) { + subBuilder = catalogItem_.toBuilder(); + } + catalogItem_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalogItem_); + catalogItem_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATALOG_ITEM_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.CatalogItem catalogItem_; + /** + * + * + *
+   * Required. The catalog item to create.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogItem field is set. + */ + public boolean hasCatalogItem() { + return catalogItem_ != null; + } + /** + * + * + *
+   * Required. The catalog item to create.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogItem. + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem() { + return catalogItem_ == null + ? com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance() + : catalogItem_; + } + /** + * + * + *
+   * Required. The catalog item to create.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemOrBuilder() { + return getCatalogItem(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (catalogItem_ != null) { + output.writeMessage(2, getCatalogItem()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (catalogItem_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCatalogItem()); + } + 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.recommendationengine.v1beta1.CreateCatalogItemRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest other = + (com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasCatalogItem() != other.hasCatalogItem()) return false; + if (hasCatalogItem()) { + if (!getCatalogItem().equals(other.getCatalogItem())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasCatalogItem()) { + hash = (37 * hash) + CATALOG_ITEM_FIELD_NUMBER; + hash = (53 * hash) + getCatalogItem().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest 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.recommendationengine.v1beta1.CreateCatalogItemRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest 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.recommendationengine.v1beta1.CreateCatalogItemRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest 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.recommendationengine.v1beta1.CreateCatalogItemRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + 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.recommendationengine.v1beta1.CreateCatalogItemRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest 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.recommendationengine.v1beta1.CreateCatalogItemRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for CreateCatalogItem method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest.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(); + parent_ = ""; + + if (catalogItemBuilder_ == null) { + catalogItem_ = null; + } else { + catalogItem_ = null; + catalogItemBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_CreateCatalogItemRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest build() { + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest result = + new com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest(this); + result.parent_ = parent_; + if (catalogItemBuilder_ == null) { + result.catalogItem_ = catalogItem_; + } else { + result.catalogItem_ = catalogItemBuilder_.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.recommendationengine.v1beta1.CreateCatalogItemRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasCatalogItem()) { + mergeCatalogItem(other.getCatalogItem()); + } + 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.recommendationengine.v1beta1.CreateCatalogItemRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.CatalogItem catalogItem_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + catalogItemBuilder_; + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogItem field is set. + */ + public boolean hasCatalogItem() { + return catalogItemBuilder_ != null || catalogItem_ != null; + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogItem. + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem() { + if (catalogItemBuilder_ == null) { + return catalogItem_ == null + ? com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance() + : catalogItem_; + } else { + return catalogItemBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogItem(com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalogItem_ = value; + onChanged(); + } else { + catalogItemBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemBuilder_ == null) { + catalogItem_ = builderForValue.build(); + onChanged(); + } else { + catalogItemBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemBuilder_ == null) { + if (catalogItem_ != null) { + catalogItem_ = + com.google.cloud.recommendationengine.v1beta1.CatalogItem.newBuilder(catalogItem_) + .mergeFrom(value) + .buildPartial(); + } else { + catalogItem_ = value; + } + onChanged(); + } else { + catalogItemBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalogItem() { + if (catalogItemBuilder_ == null) { + catalogItem_ = null; + onChanged(); + } else { + catalogItem_ = null; + catalogItemBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder + getCatalogItemBuilder() { + + onChanged(); + return getCatalogItemFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemOrBuilder() { + if (catalogItemBuilder_ != null) { + return catalogItemBuilder_.getMessageOrBuilder(); + } else { + return catalogItem_ == null + ? com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance() + : catalogItem_; + } + } + /** + * + * + *
+     * Required. The catalog item to create.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemFieldBuilder() { + if (catalogItemBuilder_ == null) { + catalogItemBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder>( + getCatalogItem(), getParentForChildren(), isClean()); + catalogItem_ = null; + } + return catalogItemBuilder_; + } + + @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.recommendationengine.v1beta1.CreateCatalogItemRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) + private static final com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateCatalogItemRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateCatalogItemRequest(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.recommendationengine.v1beta1.CreateCatalogItemRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreateCatalogItemRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreateCatalogItemRequestOrBuilder.java new file mode 100644 index 00000000..04d5489d --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreateCatalogItemRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface CreateCatalogItemRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The catalog item to create.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogItem field is set. + */ + boolean hasCatalogItem(); + /** + * + * + *
+   * Required. The catalog item to create.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogItem. + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem(); + /** + * + * + *
+   * Required. The catalog item to create.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder getCatalogItemOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreatePredictionApiKeyRegistrationRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreatePredictionApiKeyRegistrationRequest.java new file mode 100644 index 00000000..a5ff2c9f --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreatePredictionApiKeyRegistrationRequest.java @@ -0,0 +1,1020 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for the `CreatePredictionApiKeyRegistration` method.
+ * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest} + */ +public final class CreatePredictionApiKeyRegistrationRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) + CreatePredictionApiKeyRegistrationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatePredictionApiKeyRegistrationRequest.newBuilder() to construct. + private CreatePredictionApiKeyRegistrationRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatePredictionApiKeyRegistrationRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatePredictionApiKeyRegistrationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreatePredictionApiKeyRegistrationRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + subBuilder = null; + if (predictionApiKeyRegistration_ != null) { + subBuilder = predictionApiKeyRegistration_.toBuilder(); + } + predictionApiKeyRegistration_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(predictionApiKeyRegistration_); + predictionApiKeyRegistration_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + .class, + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + .Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREDICTION_API_KEY_REGISTRATION_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + predictionApiKeyRegistration_; + /** + * + * + *
+   * Required. The prediction API key registration.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + * + * @return Whether the predictionApiKeyRegistration field is set. + */ + public boolean hasPredictionApiKeyRegistration() { + return predictionApiKeyRegistration_ != null; + } + /** + * + * + *
+   * Required. The prediction API key registration.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + * + * @return The predictionApiKeyRegistration. + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getPredictionApiKeyRegistration() { + return predictionApiKeyRegistration_ == null + ? com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance() + : predictionApiKeyRegistration_; + } + /** + * + * + *
+   * Required. The prediction API key registration.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder + getPredictionApiKeyRegistrationOrBuilder() { + return getPredictionApiKeyRegistration(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (predictionApiKeyRegistration_ != null) { + output.writeMessage(2, getPredictionApiKeyRegistration()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (predictionApiKeyRegistration_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getPredictionApiKeyRegistration()); + } + 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.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest other = + (com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) + obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasPredictionApiKeyRegistration() != other.hasPredictionApiKeyRegistration()) return false; + if (hasPredictionApiKeyRegistration()) { + if (!getPredictionApiKeyRegistration().equals(other.getPredictionApiKeyRegistration())) + 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasPredictionApiKeyRegistration()) { + hash = (37 * hash) + PREDICTION_API_KEY_REGISTRATION_FIELD_NUMBER; + hash = (53 * hash) + getPredictionApiKeyRegistration().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `CreatePredictionApiKeyRegistration` method.
+   * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) + com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest.class, + com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest.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(); + parent_ = ""; + + if (predictionApiKeyRegistrationBuilder_ == null) { + predictionApiKeyRegistration_ = null; + } else { + predictionApiKeyRegistration_ = null; + predictionApiKeyRegistrationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + build() { + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + result = + new com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest(this); + result.parent_ = parent_; + if (predictionApiKeyRegistrationBuilder_ == null) { + result.predictionApiKeyRegistration_ = predictionApiKeyRegistration_; + } else { + result.predictionApiKeyRegistration_ = predictionApiKeyRegistrationBuilder_.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.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasPredictionApiKeyRegistration()) { + mergePredictionApiKeyRegistration(other.getPredictionApiKeyRegistration()); + } + 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.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + predictionApiKeyRegistration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + predictionApiKeyRegistrationBuilder_; + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + * + * @return Whether the predictionApiKeyRegistration field is set. + */ + public boolean hasPredictionApiKeyRegistration() { + return predictionApiKeyRegistrationBuilder_ != null || predictionApiKeyRegistration_ != null; + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + * + * @return The predictionApiKeyRegistration. + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getPredictionApiKeyRegistration() { + if (predictionApiKeyRegistrationBuilder_ == null) { + return predictionApiKeyRegistration_ == null + ? com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance() + : predictionApiKeyRegistration_; + } else { + return predictionApiKeyRegistrationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public Builder setPredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration value) { + if (predictionApiKeyRegistrationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predictionApiKeyRegistration_ = value; + onChanged(); + } else { + predictionApiKeyRegistrationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public Builder setPredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + builderForValue) { + if (predictionApiKeyRegistrationBuilder_ == null) { + predictionApiKeyRegistration_ = builderForValue.build(); + onChanged(); + } else { + predictionApiKeyRegistrationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public Builder mergePredictionApiKeyRegistration( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration value) { + if (predictionApiKeyRegistrationBuilder_ == null) { + if (predictionApiKeyRegistration_ != null) { + predictionApiKeyRegistration_ = + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.newBuilder( + predictionApiKeyRegistration_) + .mergeFrom(value) + .buildPartial(); + } else { + predictionApiKeyRegistration_ = value; + } + onChanged(); + } else { + predictionApiKeyRegistrationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public Builder clearPredictionApiKeyRegistration() { + if (predictionApiKeyRegistrationBuilder_ == null) { + predictionApiKeyRegistration_ = null; + onChanged(); + } else { + predictionApiKeyRegistration_ = null; + predictionApiKeyRegistrationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + getPredictionApiKeyRegistrationBuilder() { + + onChanged(); + return getPredictionApiKeyRegistrationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder + getPredictionApiKeyRegistrationOrBuilder() { + if (predictionApiKeyRegistrationBuilder_ != null) { + return predictionApiKeyRegistrationBuilder_.getMessageOrBuilder(); + } else { + return predictionApiKeyRegistration_ == null + ? com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance() + : predictionApiKeyRegistration_; + } + } + /** + * + * + *
+     * Required. The prediction API key registration.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + getPredictionApiKeyRegistrationFieldBuilder() { + if (predictionApiKeyRegistrationBuilder_ == null) { + predictionApiKeyRegistrationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder, + com.google.cloud.recommendationengine.v1beta1 + .PredictionApiKeyRegistrationOrBuilder>( + getPredictionApiKeyRegistration(), getParentForChildren(), isClean()); + predictionApiKeyRegistration_ = null; + } + return predictionApiKeyRegistrationBuilder_; + } + + @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.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) + private static final com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .CreatePredictionApiKeyRegistrationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePredictionApiKeyRegistrationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreatePredictionApiKeyRegistrationRequest(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.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreatePredictionApiKeyRegistrationRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreatePredictionApiKeyRegistrationRequestOrBuilder.java new file mode 100644 index 00000000..2651ea4e --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/CreatePredictionApiKeyRegistrationRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface CreatePredictionApiKeyRegistrationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The prediction API key registration.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + * + * @return Whether the predictionApiKeyRegistration field is set. + */ + boolean hasPredictionApiKeyRegistration(); + /** + * + * + *
+   * Required. The prediction API key registration.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + * + * @return The predictionApiKeyRegistration. + */ + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getPredictionApiKeyRegistration(); + /** + * + * + *
+   * Required. The prediction API key registration.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder + getPredictionApiKeyRegistrationOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeleteCatalogItemRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeleteCatalogItemRequest.java new file mode 100644 index 00000000..293365b2 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeleteCatalogItemRequest.java @@ -0,0 +1,654 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for DeleteCatalogItem method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest} + */ +public final class DeleteCatalogItemRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) + DeleteCatalogItemRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteCatalogItemRequest.newBuilder() to construct. + private DeleteCatalogItemRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteCatalogItemRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteCatalogItemRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteCatalogItemRequest( + 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; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.recommendationengine.v1beta1.DeleteCatalogItemRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest other = + (com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest 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.recommendationengine.v1beta1.DeleteCatalogItemRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest 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.recommendationengine.v1beta1.DeleteCatalogItemRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest 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.recommendationengine.v1beta1.DeleteCatalogItemRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + 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.recommendationengine.v1beta1.DeleteCatalogItemRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest 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.recommendationengine.v1beta1.DeleteCatalogItemRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DeleteCatalogItem method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_DeleteCatalogItemRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest build() { + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest result = + new com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest(this); + result.name_ = name_; + 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.recommendationengine.v1beta1.DeleteCatalogItemRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + + @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.recommendationengine.v1beta1.DeleteCatalogItemRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) + private static final com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCatalogItemRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteCatalogItemRequest(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.recommendationengine.v1beta1.DeleteCatalogItemRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeleteCatalogItemRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeleteCatalogItemRequestOrBuilder.java new file mode 100644 index 00000000..78204923 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeleteCatalogItemRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface DeleteCatalogItemRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeletePredictionApiKeyRegistrationRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeletePredictionApiKeyRegistrationRequest.java new file mode 100644 index 00000000..d5947946 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeletePredictionApiKeyRegistrationRequest.java @@ -0,0 +1,700 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for `DeletePredictionApiKeyRegistration` method.
+ * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest} + */ +public final class DeletePredictionApiKeyRegistrationRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) + DeletePredictionApiKeyRegistrationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletePredictionApiKeyRegistrationRequest.newBuilder() to construct. + private DeletePredictionApiKeyRegistrationRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletePredictionApiKeyRegistrationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletePredictionApiKeyRegistrationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeletePredictionApiKeyRegistrationRequest( + 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; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + .class, + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The API key to unregister including full resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The API key to unregister including full resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest other = + (com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) + obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + 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.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `DeletePredictionApiKeyRegistration` method.
+   * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) + com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest.class, + com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + build() { + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + result = + new com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest(this); + result.name_ = name_; + 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.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The API key to unregister including full resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The API key to unregister including full resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The API key to unregister including full resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + /** + * + * + *
+     * Required. The API key to unregister including full resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The API key to unregister including full resource path.
+     * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + + @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.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) + private static final com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .DeletePredictionApiKeyRegistrationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePredictionApiKeyRegistrationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeletePredictionApiKeyRegistrationRequest(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.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeletePredictionApiKeyRegistrationRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeletePredictionApiKeyRegistrationRequestOrBuilder.java new file mode 100644 index 00000000..f2c850b8 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/DeletePredictionApiKeyRegistrationRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface DeletePredictionApiKeyRegistrationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The API key to unregister including full resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The API key to unregister including full resource path.
+   * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventDetail.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventDetail.java new file mode 100644 index 00000000..9dcce761 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventDetail.java @@ -0,0 +1,1990 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * User event details shared by all recommendation types.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.EventDetail} + */ +public final class EventDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.EventDetail) + EventDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventDetail.newBuilder() to construct. + private EventDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventDetail() { + uri_ = ""; + referrerUri_ = ""; + pageViewId_ = ""; + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + recommendationToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventDetail( + 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(); + + uri_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageViewId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + experimentIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + experimentIds_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + recommendationToken_ = s; + break; + } + case 42: + { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder subBuilder = null; + if (eventAttributes_ != null) { + subBuilder = eventAttributes_.toBuilder(); + } + eventAttributes_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventAttributes_); + eventAttributes_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + referrerUri_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + experimentIds_ = experimentIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.EventDetail.class, + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Optional. Complete url (window.location.href) of the user's current page.
+   * When using the JavaScript pixel, this value is filled in automatically.
+   * Maximum length 5KB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Complete url (window.location.href) of the user's current page.
+   * When using the JavaScript pixel, this value is filled in automatically.
+   * Maximum length 5KB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERRER_URI_FIELD_NUMBER = 6; + private volatile java.lang.Object referrerUri_; + /** + * + * + *
+   * Optional. The referrer url of the current page. When using
+   * the JavaScript pixel, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The referrerUri. + */ + public java.lang.String getReferrerUri() { + java.lang.Object ref = referrerUri_; + 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(); + referrerUri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The referrer url of the current page. When using
+   * the JavaScript pixel, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for referrerUri. + */ + public com.google.protobuf.ByteString getReferrerUriBytes() { + java.lang.Object ref = referrerUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referrerUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_VIEW_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object pageViewId_; + /** + * + * + *
+   * Optional. A unique id of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page.
+   * The `pageViewId` property should be kept the same for all these events so
+   * that they can be grouped together properly. This `pageViewId` will be
+   * automatically generated if using the JavaScript pixel.
+   * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageViewId. + */ + public java.lang.String getPageViewId() { + java.lang.Object ref = pageViewId_; + 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(); + pageViewId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique id of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page.
+   * The `pageViewId` property should be kept the same for all these events so
+   * that they can be grouped together properly. This `pageViewId` will be
+   * automatically generated if using the JavaScript pixel.
+   * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageViewId. + */ + public com.google.protobuf.ByteString getPageViewIdBytes() { + java.lang.Object ref = pageViewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPERIMENT_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList experimentIds_; + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the experimentIds. + */ + public com.google.protobuf.ProtocolStringList getExperimentIdsList() { + return experimentIds_; + } + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of experimentIds. + */ + public int getExperimentIdsCount() { + return experimentIds_.size(); + } + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + public java.lang.String getExperimentIds(int index) { + return experimentIds_.get(index); + } + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { + return experimentIds_.getByteString(index); + } + + public static final int RECOMMENDATION_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object recommendationToken_; + /** + * + * + *
+   * Optional. Recommendation token included in the recommendation prediction
+   * response.
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased item. If user clicks on product K in the recommendation
+   * results, pass the `PredictResponse.recommendationToken` property as a url
+   * parameter to product K's page. When recording events on product K's page,
+   * log the PredictResponse.recommendation_token to this field.
+   * Optional, but highly encouraged for user events that are the result of a
+   * recommendation prediction query.
+   * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recommendationToken. + */ + public java.lang.String getRecommendationToken() { + java.lang.Object ref = recommendationToken_; + 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(); + recommendationToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Recommendation token included in the recommendation prediction
+   * response.
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased item. If user clicks on product K in the recommendation
+   * results, pass the `PredictResponse.recommendationToken` property as a url
+   * parameter to product K's page. When recording events on product K's page,
+   * log the PredictResponse.recommendation_token to this field.
+   * Optional, but highly encouraged for user events that are the result of a
+   * recommendation prediction query.
+   * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for recommendationToken. + */ + public com.google.protobuf.ByteString getRecommendationTokenBytes() { + java.lang.Object ref = recommendationToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recommendationToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_ATTRIBUTES_FIELD_NUMBER = 5; + private com.google.cloud.recommendationengine.v1beta1.FeatureMap eventAttributes_; + /** + * + * + *
+   * Optional. Extra user event features to include in the recommendation
+   * model.
+   * For product recommendation, an example of extra user information is
+   * traffic_channel, i.e. how user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, or coming through Google
+   * search, and etc.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventAttributes field is set. + */ + public boolean hasEventAttributes() { + return eventAttributes_ != null; + } + /** + * + * + *
+   * Optional. Extra user event features to include in the recommendation
+   * model.
+   * For product recommendation, an example of extra user information is
+   * traffic_channel, i.e. how user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, or coming through Google
+   * search, and etc.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventAttributes. + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getEventAttributes() { + return eventAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : eventAttributes_; + } + /** + * + * + *
+   * Optional. Extra user event features to include in the recommendation
+   * model.
+   * For product recommendation, an example of extra user information is
+   * traffic_channel, i.e. how user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, or coming through Google
+   * search, and etc.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder + getEventAttributesOrBuilder() { + return getEventAttributes(); + } + + 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 (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (!getPageViewIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageViewId_); + } + for (int i = 0; i < experimentIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, experimentIds_.getRaw(i)); + } + if (!getRecommendationTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, recommendationToken_); + } + if (eventAttributes_ != null) { + output.writeMessage(5, getEventAttributes()); + } + if (!getReferrerUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, referrerUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (!getPageViewIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageViewId_); + } + { + int dataSize = 0; + for (int i = 0; i < experimentIds_.size(); i++) { + dataSize += computeStringSizeNoTag(experimentIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getExperimentIdsList().size(); + } + if (!getRecommendationTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, recommendationToken_); + } + if (eventAttributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEventAttributes()); + } + if (!getReferrerUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, referrerUri_); + } + 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.recommendationengine.v1beta1.EventDetail)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.EventDetail other = + (com.google.cloud.recommendationengine.v1beta1.EventDetail) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getReferrerUri().equals(other.getReferrerUri())) return false; + if (!getPageViewId().equals(other.getPageViewId())) return false; + if (!getExperimentIdsList().equals(other.getExperimentIdsList())) return false; + if (!getRecommendationToken().equals(other.getRecommendationToken())) return false; + if (hasEventAttributes() != other.hasEventAttributes()) return false; + if (hasEventAttributes()) { + if (!getEventAttributes().equals(other.getEventAttributes())) 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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + REFERRER_URI_FIELD_NUMBER; + hash = (53 * hash) + getReferrerUri().hashCode(); + hash = (37 * hash) + PAGE_VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getPageViewId().hashCode(); + if (getExperimentIdsCount() > 0) { + hash = (37 * hash) + EXPERIMENT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getExperimentIdsList().hashCode(); + } + hash = (37 * hash) + RECOMMENDATION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRecommendationToken().hashCode(); + if (hasEventAttributes()) { + hash = (37 * hash) + EVENT_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getEventAttributes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail 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.recommendationengine.v1beta1.EventDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail 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.recommendationengine.v1beta1.EventDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail 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.recommendationengine.v1beta1.EventDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail 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.recommendationengine.v1beta1.EventDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail 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.recommendationengine.v1beta1.EventDetail 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; + } + /** + * + * + *
+   * User event details shared by all recommendation types.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.EventDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.EventDetail) + com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.EventDetail.class, + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.EventDetail.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(); + uri_ = ""; + + referrerUri_ = ""; + + pageViewId_ = ""; + + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + recommendationToken_ = ""; + + if (eventAttributesBuilder_ == null) { + eventAttributes_ = null; + } else { + eventAttributes_ = null; + eventAttributesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.EventDetail getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.EventDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.EventDetail build() { + com.google.cloud.recommendationengine.v1beta1.EventDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.EventDetail buildPartial() { + com.google.cloud.recommendationengine.v1beta1.EventDetail result = + new com.google.cloud.recommendationengine.v1beta1.EventDetail(this); + int from_bitField0_ = bitField0_; + result.uri_ = uri_; + result.referrerUri_ = referrerUri_; + result.pageViewId_ = pageViewId_; + if (((bitField0_ & 0x00000001) != 0)) { + experimentIds_ = experimentIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.experimentIds_ = experimentIds_; + result.recommendationToken_ = recommendationToken_; + if (eventAttributesBuilder_ == null) { + result.eventAttributes_ = eventAttributes_; + } else { + result.eventAttributes_ = eventAttributesBuilder_.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.recommendationengine.v1beta1.EventDetail) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.EventDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.EventDetail other) { + if (other == com.google.cloud.recommendationengine.v1beta1.EventDetail.getDefaultInstance()) + return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getReferrerUri().isEmpty()) { + referrerUri_ = other.referrerUri_; + onChanged(); + } + if (!other.getPageViewId().isEmpty()) { + pageViewId_ = other.pageViewId_; + onChanged(); + } + if (!other.experimentIds_.isEmpty()) { + if (experimentIds_.isEmpty()) { + experimentIds_ = other.experimentIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExperimentIdsIsMutable(); + experimentIds_.addAll(other.experimentIds_); + } + onChanged(); + } + if (!other.getRecommendationToken().isEmpty()) { + recommendationToken_ = other.recommendationToken_; + onChanged(); + } + if (other.hasEventAttributes()) { + mergeEventAttributes(other.getEventAttributes()); + } + 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.recommendationengine.v1beta1.EventDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.EventDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Optional. Complete url (window.location.href) of the user's current page.
+     * When using the JavaScript pixel, this value is filled in automatically.
+     * Maximum length 5KB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Complete url (window.location.href) of the user's current page.
+     * When using the JavaScript pixel, this value is filled in automatically.
+     * Maximum length 5KB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Complete url (window.location.href) of the user's current page.
+     * When using the JavaScript pixel, this value is filled in automatically.
+     * Maximum length 5KB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Complete url (window.location.href) of the user's current page.
+     * When using the JavaScript pixel, this value is filled in automatically.
+     * Maximum length 5KB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Complete url (window.location.href) of the user's current page.
+     * When using the JavaScript pixel, this value is filled in automatically.
+     * Maximum length 5KB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.lang.Object referrerUri_ = ""; + /** + * + * + *
+     * Optional. The referrer url of the current page. When using
+     * the JavaScript pixel, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The referrerUri. + */ + public java.lang.String getReferrerUri() { + java.lang.Object ref = referrerUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referrerUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The referrer url of the current page. When using
+     * the JavaScript pixel, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for referrerUri. + */ + public com.google.protobuf.ByteString getReferrerUriBytes() { + java.lang.Object ref = referrerUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referrerUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The referrer url of the current page. When using
+     * the JavaScript pixel, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The referrerUri to set. + * @return This builder for chaining. + */ + public Builder setReferrerUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referrerUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The referrer url of the current page. When using
+     * the JavaScript pixel, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReferrerUri() { + + referrerUri_ = getDefaultInstance().getReferrerUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The referrer url of the current page. When using
+     * the JavaScript pixel, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for referrerUri to set. + * @return This builder for chaining. + */ + public Builder setReferrerUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referrerUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageViewId_ = ""; + /** + * + * + *
+     * Optional. A unique id of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page.
+     * The `pageViewId` property should be kept the same for all these events so
+     * that they can be grouped together properly. This `pageViewId` will be
+     * automatically generated if using the JavaScript pixel.
+     * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageViewId. + */ + public java.lang.String getPageViewId() { + java.lang.Object ref = pageViewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageViewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique id of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page.
+     * The `pageViewId` property should be kept the same for all these events so
+     * that they can be grouped together properly. This `pageViewId` will be
+     * automatically generated if using the JavaScript pixel.
+     * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageViewId. + */ + public com.google.protobuf.ByteString getPageViewIdBytes() { + java.lang.Object ref = pageViewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique id of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page.
+     * The `pageViewId` property should be kept the same for all these events so
+     * that they can be grouped together properly. This `pageViewId` will be
+     * automatically generated if using the JavaScript pixel.
+     * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageViewId to set. + * @return This builder for chaining. + */ + public Builder setPageViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageViewId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique id of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page.
+     * The `pageViewId` property should be kept the same for all these events so
+     * that they can be grouped together properly. This `pageViewId` will be
+     * automatically generated if using the JavaScript pixel.
+     * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageViewId() { + + pageViewId_ = getDefaultInstance().getPageViewId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique id of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page.
+     * The `pageViewId` property should be kept the same for all these events so
+     * that they can be grouped together properly. This `pageViewId` will be
+     * automatically generated if using the JavaScript pixel.
+     * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageViewId to set. + * @return This builder for chaining. + */ + public Builder setPageViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageViewId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList experimentIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExperimentIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + experimentIds_ = new com.google.protobuf.LazyStringArrayList(experimentIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the experimentIds. + */ + public com.google.protobuf.ProtocolStringList getExperimentIdsList() { + return experimentIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of experimentIds. + */ + public int getExperimentIdsCount() { + return experimentIds_.size(); + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + public java.lang.String getExperimentIds(int index) { + return experimentIds_.get(index); + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { + return experimentIds_.getByteString(index); + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The experimentIds to set. + * @return This builder for chaining. + */ + public Builder setExperimentIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentIdsIsMutable(); + experimentIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The experimentIds to add. + * @return This builder for chaining. + */ + public Builder addExperimentIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentIdsIsMutable(); + experimentIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The experimentIds to add. + * @return This builder for chaining. + */ + public Builder addAllExperimentIds(java.lang.Iterable values) { + ensureExperimentIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, experimentIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearExperimentIds() { + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of identifiers for the independent experiment groups
+     * this user event belongs to. This is used to distinguish between user events
+     * associated with different experiment setups (e.g. using Recommendation
+     * Engine system, using different recommendation models).
+     * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the experimentIds to add. + * @return This builder for chaining. + */ + public Builder addExperimentIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExperimentIdsIsMutable(); + experimentIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object recommendationToken_ = ""; + /** + * + * + *
+     * Optional. Recommendation token included in the recommendation prediction
+     * response.
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased item. If user clicks on product K in the recommendation
+     * results, pass the `PredictResponse.recommendationToken` property as a url
+     * parameter to product K's page. When recording events on product K's page,
+     * log the PredictResponse.recommendation_token to this field.
+     * Optional, but highly encouraged for user events that are the result of a
+     * recommendation prediction query.
+     * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recommendationToken. + */ + public java.lang.String getRecommendationToken() { + java.lang.Object ref = recommendationToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recommendationToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Recommendation token included in the recommendation prediction
+     * response.
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased item. If user clicks on product K in the recommendation
+     * results, pass the `PredictResponse.recommendationToken` property as a url
+     * parameter to product K's page. When recording events on product K's page,
+     * log the PredictResponse.recommendation_token to this field.
+     * Optional, but highly encouraged for user events that are the result of a
+     * recommendation prediction query.
+     * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for recommendationToken. + */ + public com.google.protobuf.ByteString getRecommendationTokenBytes() { + java.lang.Object ref = recommendationToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recommendationToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Recommendation token included in the recommendation prediction
+     * response.
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased item. If user clicks on product K in the recommendation
+     * results, pass the `PredictResponse.recommendationToken` property as a url
+     * parameter to product K's page. When recording events on product K's page,
+     * log the PredictResponse.recommendation_token to this field.
+     * Optional, but highly encouraged for user events that are the result of a
+     * recommendation prediction query.
+     * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The recommendationToken to set. + * @return This builder for chaining. + */ + public Builder setRecommendationToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recommendationToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Recommendation token included in the recommendation prediction
+     * response.
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased item. If user clicks on product K in the recommendation
+     * results, pass the `PredictResponse.recommendationToken` property as a url
+     * parameter to product K's page. When recording events on product K's page,
+     * log the PredictResponse.recommendation_token to this field.
+     * Optional, but highly encouraged for user events that are the result of a
+     * recommendation prediction query.
+     * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRecommendationToken() { + + recommendationToken_ = getDefaultInstance().getRecommendationToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Recommendation token included in the recommendation prediction
+     * response.
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased item. If user clicks on product K in the recommendation
+     * results, pass the `PredictResponse.recommendationToken` property as a url
+     * parameter to product K's page. When recording events on product K's page,
+     * log the PredictResponse.recommendation_token to this field.
+     * Optional, but highly encouraged for user events that are the result of a
+     * recommendation prediction query.
+     * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for recommendationToken to set. + * @return This builder for chaining. + */ + public Builder setRecommendationTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recommendationToken_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.FeatureMap eventAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder> + eventAttributesBuilder_; + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventAttributes field is set. + */ + public boolean hasEventAttributes() { + return eventAttributesBuilder_ != null || eventAttributes_ != null; + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventAttributes. + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getEventAttributes() { + if (eventAttributesBuilder_ == null) { + return eventAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : eventAttributes_; + } else { + return eventAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap value) { + if (eventAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventAttributes_ = value; + onChanged(); + } else { + eventAttributesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder builderForValue) { + if (eventAttributesBuilder_ == null) { + eventAttributes_ = builderForValue.build(); + onChanged(); + } else { + eventAttributesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEventAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap value) { + if (eventAttributesBuilder_ == null) { + if (eventAttributes_ != null) { + eventAttributes_ = + com.google.cloud.recommendationengine.v1beta1.FeatureMap.newBuilder(eventAttributes_) + .mergeFrom(value) + .buildPartial(); + } else { + eventAttributes_ = value; + } + onChanged(); + } else { + eventAttributesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEventAttributes() { + if (eventAttributesBuilder_ == null) { + eventAttributes_ = null; + onChanged(); + } else { + eventAttributes_ = null; + eventAttributesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder + getEventAttributesBuilder() { + + onChanged(); + return getEventAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder + getEventAttributesOrBuilder() { + if (eventAttributesBuilder_ != null) { + return eventAttributesBuilder_.getMessageOrBuilder(); + } else { + return eventAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : eventAttributes_; + } + } + /** + * + * + *
+     * Optional. Extra user event features to include in the recommendation
+     * model.
+     * For product recommendation, an example of extra user information is
+     * traffic_channel, i.e. how user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, or coming through Google
+     * search, and etc.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder> + getEventAttributesFieldBuilder() { + if (eventAttributesBuilder_ == null) { + eventAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder>( + getEventAttributes(), getParentForChildren(), isClean()); + eventAttributes_ = null; + } + return eventAttributesBuilder_; + } + + @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.recommendationengine.v1beta1.EventDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.EventDetail) + private static final com.google.cloud.recommendationengine.v1beta1.EventDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.EventDetail(); + } + + public static com.google.cloud.recommendationengine.v1beta1.EventDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventDetail(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.recommendationengine.v1beta1.EventDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventDetailOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventDetailOrBuilder.java new file mode 100644 index 00000000..83f965f8 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventDetailOrBuilder.java @@ -0,0 +1,284 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface EventDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.EventDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Complete url (window.location.href) of the user's current page.
+   * When using the JavaScript pixel, this value is filled in automatically.
+   * Maximum length 5KB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Optional. Complete url (window.location.href) of the user's current page.
+   * When using the JavaScript pixel, this value is filled in automatically.
+   * Maximum length 5KB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Optional. The referrer url of the current page. When using
+   * the JavaScript pixel, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The referrerUri. + */ + java.lang.String getReferrerUri(); + /** + * + * + *
+   * Optional. The referrer url of the current page. When using
+   * the JavaScript pixel, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for referrerUri. + */ + com.google.protobuf.ByteString getReferrerUriBytes(); + + /** + * + * + *
+   * Optional. A unique id of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page.
+   * The `pageViewId` property should be kept the same for all these events so
+   * that they can be grouped together properly. This `pageViewId` will be
+   * automatically generated if using the JavaScript pixel.
+   * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageViewId. + */ + java.lang.String getPageViewId(); + /** + * + * + *
+   * Optional. A unique id of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page.
+   * The `pageViewId` property should be kept the same for all these events so
+   * that they can be grouped together properly. This `pageViewId` will be
+   * automatically generated if using the JavaScript pixel.
+   * 
+ * + * string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageViewId. + */ + com.google.protobuf.ByteString getPageViewIdBytes(); + + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the experimentIds. + */ + java.util.List getExperimentIdsList(); + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of experimentIds. + */ + int getExperimentIdsCount(); + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + java.lang.String getExperimentIds(int index); + /** + * + * + *
+   * Optional. A list of identifiers for the independent experiment groups
+   * this user event belongs to. This is used to distinguish between user events
+   * associated with different experiment setups (e.g. using Recommendation
+   * Engine system, using different recommendation models).
+   * 
+ * + * repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + com.google.protobuf.ByteString getExperimentIdsBytes(int index); + + /** + * + * + *
+   * Optional. Recommendation token included in the recommendation prediction
+   * response.
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased item. If user clicks on product K in the recommendation
+   * results, pass the `PredictResponse.recommendationToken` property as a url
+   * parameter to product K's page. When recording events on product K's page,
+   * log the PredictResponse.recommendation_token to this field.
+   * Optional, but highly encouraged for user events that are the result of a
+   * recommendation prediction query.
+   * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recommendationToken. + */ + java.lang.String getRecommendationToken(); + /** + * + * + *
+   * Optional. Recommendation token included in the recommendation prediction
+   * response.
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased item. If user clicks on product K in the recommendation
+   * results, pass the `PredictResponse.recommendationToken` property as a url
+   * parameter to product K's page. When recording events on product K's page,
+   * log the PredictResponse.recommendation_token to this field.
+   * Optional, but highly encouraged for user events that are the result of a
+   * recommendation prediction query.
+   * 
+ * + * string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for recommendationToken. + */ + com.google.protobuf.ByteString getRecommendationTokenBytes(); + + /** + * + * + *
+   * Optional. Extra user event features to include in the recommendation
+   * model.
+   * For product recommendation, an example of extra user information is
+   * traffic_channel, i.e. how user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, or coming through Google
+   * search, and etc.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventAttributes field is set. + */ + boolean hasEventAttributes(); + /** + * + * + *
+   * Optional. Extra user event features to include in the recommendation
+   * model.
+   * For product recommendation, an example of extra user information is
+   * traffic_channel, i.e. how user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, or coming through Google
+   * search, and etc.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventAttributes. + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap getEventAttributes(); + /** + * + * + *
+   * Optional. Extra user event features to include in the recommendation
+   * model.
+   * For product recommendation, an example of extra user information is
+   * traffic_channel, i.e. how user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, or coming through Google
+   * search, and etc.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder getEventAttributesOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventStoreName.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventStoreName.java new file mode 100644 index 00000000..f99b9399 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/EventStoreName.java @@ -0,0 +1,243 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class EventStoreName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String catalog; + private final String eventStore; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getEventStore() { + return eventStore; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private EventStoreName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + eventStore = Preconditions.checkNotNull(builder.getEventStore()); + } + + public static EventStoreName of( + String project, String location, String catalog, String eventStore) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setEventStore(eventStore) + .build(); + } + + public static String format(String project, String location, String catalog, String eventStore) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setEventStore(eventStore) + .build() + .toString(); + } + + public static EventStoreName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "EventStoreName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("event_store")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (EventStoreName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("catalog", catalog); + fieldMapBuilder.put("eventStore", eventStore); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "catalog", catalog, "event_store", eventStore); + } + + /** Builder for EventStoreName. */ + public static class Builder { + + private String project; + private String location; + private String catalog; + private String eventStore; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getEventStore() { + return eventStore; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public Builder setEventStore(String eventStore) { + this.eventStore = eventStore; + return this; + } + + private Builder() {} + + private Builder(EventStoreName eventStoreName) { + project = eventStoreName.project; + location = eventStoreName.location; + catalog = eventStoreName.catalog; + eventStore = eventStoreName.eventStore; + } + + public EventStoreName build() { + return new EventStoreName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof EventStoreName) { + EventStoreName that = (EventStoreName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.catalog.equals(that.catalog)) + && (this.eventStore.equals(that.eventStore)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= catalog.hashCode(); + h *= 1000003; + h ^= eventStore.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/FeatureMap.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/FeatureMap.java new file mode 100644 index 00000000..39471c85 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/FeatureMap.java @@ -0,0 +1,2864 @@ +/* + * 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/recommendationengine/v1beta1/common.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * FeatureMap represents extra features that customers want to include in the
+ * recommendation model for catalogs/user events as categorical/numerical
+ * features.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.FeatureMap} + */ +public final class FeatureMap extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.FeatureMap) + FeatureMapOrBuilder { + private static final long serialVersionUID = 0L; + // Use FeatureMap.newBuilder() to construct. + private FeatureMap(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FeatureMap() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FeatureMap(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FeatureMap( + 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)) { + categoricalFeatures_ = + com.google.protobuf.MapField.newMapField( + CategoricalFeaturesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + categoricalFeatures__ = + input.readMessage( + CategoricalFeaturesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + categoricalFeatures_ + .getMutableMap() + .put(categoricalFeatures__.getKey(), categoricalFeatures__.getValue()); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + numericalFeatures_ = + com.google.protobuf.MapField.newMapField( + NumericalFeaturesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + numericalFeatures__ = + input.readMessage( + NumericalFeaturesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + numericalFeatures_ + .getMutableMap() + .put(numericalFeatures__.getKey(), numericalFeatures__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetCategoricalFeatures(); + case 2: + return internalGetNumericalFeatures(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.class, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder.class); + } + + public interface StringListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @return The count of value. + */ + int getValueCount(); + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @param index The index of the element to return. + * @return The value at the given index. + */ + java.lang.String getValue(int index); + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + com.google.protobuf.ByteString getValueBytes(int index); + } + /** + * + * + *
+   * A list of string features.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.FeatureMap.StringList} + */ + public static final class StringList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) + StringListOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringList.newBuilder() to construct. + private StringList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringList() { + value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StringList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + value_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + value_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + value_ = value_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList.class, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList value_; + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @return A list containing the value. + */ + public com.google.protobuf.ProtocolStringList getValueList() { + return value_; + } + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @param index The index of the element to return. + * @return The value at the given index. + */ + public java.lang.String getValue(int index) { + return value_.get(index); + } + /** + * + * + *
+     * String feature value with a length limit of 128 bytes.
+     * 
+ * + * repeated string value = 1; + * + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + public com.google.protobuf.ByteString getValueBytes(int index) { + return value_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < value_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += computeStringSizeNoTag(value_.getRaw(i)); + } + size += dataSize; + size += 1 * getValueList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList other = + (com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) obj; + + if (!getValueList().equals(other.getValueList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList 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.recommendationengine.v1beta1.FeatureMap.StringList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList 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.recommendationengine.v1beta1.FeatureMap.StringList parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList 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.recommendationengine.v1beta1.FeatureMap.StringList + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + 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.recommendationengine.v1beta1.FeatureMap.StringList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList 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.recommendationengine.v1beta1.FeatureMap.StringList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A list of string features.
+     * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.FeatureMap.StringList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList.class, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_StringList_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList build() { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList buildPartial() { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList result = + new com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + value_ = value_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + .getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList value_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureValueIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + value_ = new com.google.protobuf.LazyStringArrayList(value_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @return A list containing the value. + */ + public com.google.protobuf.ProtocolStringList getValueList() { + return value_.getUnmodifiableView(); + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @param index The index of the element to return. + * @return The value at the given index. + */ + public java.lang.String getValue(int index) { + return value_.get(index); + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + public com.google.protobuf.ByteString getValueBytes(int index) { + return value_.getByteString(index); + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue(java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, value_); + onChanged(); + return this; + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * String feature value with a length limit of 128 bytes.
+       * 
+ * + * repeated string value = 1; + * + * @param value The bytes of the value to add. + * @return This builder for chaining. + */ + public Builder addValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValueIsMutable(); + value_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.FeatureMap.StringList) + private static final com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList(); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StringList(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.recommendationengine.v1beta1.FeatureMap.StringList + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FloatListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Float feature value.
+     * 
+ * + * repeated float value = 1; + * + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * + * + *
+     * Float feature value.
+     * 
+ * + * repeated float value = 1; + * + * @return The count of value. + */ + int getValueCount(); + /** + * + * + *
+     * Float feature value.
+     * 
+ * + * repeated float value = 1; + * + * @param index The index of the element to return. + * @return The value at the given index. + */ + float getValue(int index); + } + /** + * + * + *
+   * A list of float features.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList} + */ + public static final class FloatList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) + FloatListOrBuilder { + private static final long serialVersionUID = 0L; + // Use FloatList.newBuilder() to construct. + private FloatList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FloatList() { + value_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FloatList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FloatList( + 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 13: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + value_ = newFloatList(); + mutable_bitField0_ |= 0x00000001; + } + value_.addFloat(input.readFloat()); + break; + } + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + value_ = newFloatList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + value_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList.class, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.FloatList value_; + /** + * + * + *
+     * Float feature value.
+     * 
+ * + * repeated float value = 1; + * + * @return A list containing the value. + */ + public java.util.List getValueList() { + return value_; + } + /** + * + * + *
+     * Float feature value.
+     * 
+ * + * repeated float value = 1; + * + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * + * + *
+     * Float feature value.
+     * 
+ * + * repeated float value = 1; + * + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + + private int valueMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getValueList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valueMemoizedSerializedSize); + } + for (int i = 0; i < value_.size(); i++) { + output.writeFloatNoTag(value_.getFloat(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getValueList().size(); + size += dataSize; + if (!getValueList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + 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.recommendationengine.v1beta1.FeatureMap.FloatList)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList other = + (com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) obj; + + if (!getValueList().equals(other.getValueList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList 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.recommendationengine.v1beta1.FeatureMap.FloatList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList 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.recommendationengine.v1beta1.FeatureMap.FloatList parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList 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.recommendationengine.v1beta1.FeatureMap.FloatList + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + 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.recommendationengine.v1beta1.FeatureMap.FloatList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList 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.recommendationengine.v1beta1.FeatureMap.FloatList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A list of float features.
+     * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList.class, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_FloatList_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList build() { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList buildPartial() { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList result = + new com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + .getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); + + private void ensureValueIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + value_ = mutableCopy(value_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @return A list containing the value. + */ + public java.util.List getValueList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(value_) + : value_; + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(int index, float value) { + ensureValueIsMutable(); + value_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(float value) { + ensureValueIsMutable(); + value_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue(java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, value_); + onChanged(); + return this; + } + /** + * + * + *
+       * Float feature value.
+       * 
+ * + * repeated float value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + 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.recommendationengine.v1beta1.FeatureMap.FloatList) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList) + private static final com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList(); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FloatList(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.recommendationengine.v1beta1.FeatureMap.FloatList + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CATEGORICAL_FEATURES_FIELD_NUMBER = 1; + + private static final class CategoricalFeaturesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_CategoricalFeaturesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + .getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + categoricalFeatures_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + internalGetCategoricalFeatures() { + if (categoricalFeatures_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CategoricalFeaturesDefaultEntryHolder.defaultEntry); + } + return categoricalFeatures_; + } + + public int getCategoricalFeaturesCount() { + return internalGetCategoricalFeatures().getMap().size(); + } + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public boolean containsCategoricalFeatures(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetCategoricalFeatures().getMap().containsKey(key); + } + /** Use {@link #getCategoricalFeaturesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getCategoricalFeatures() { + return getCategoricalFeaturesMap(); + } + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getCategoricalFeaturesMap() { + return internalGetCategoricalFeatures().getMap(); + } + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getCategoricalFeaturesOrDefault( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + map = internalGetCategoricalFeatures().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getCategoricalFeaturesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + map = internalGetCategoricalFeatures().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NUMERICAL_FEATURES_FIELD_NUMBER = 2; + + private static final class NumericalFeaturesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_NumericalFeaturesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + .getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + numericalFeatures_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + internalGetNumericalFeatures() { + if (numericalFeatures_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NumericalFeaturesDefaultEntryHolder.defaultEntry); + } + return numericalFeatures_; + } + + public int getNumericalFeaturesCount() { + return internalGetNumericalFeatures().getMap().size(); + } + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public boolean containsNumericalFeatures(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetNumericalFeatures().getMap().containsKey(key); + } + /** Use {@link #getNumericalFeaturesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getNumericalFeatures() { + return getNumericalFeaturesMap(); + } + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getNumericalFeaturesMap() { + return internalGetNumericalFeatures().getMap(); + } + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + getNumericalFeaturesOrDefault( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + map = internalGetNumericalFeatures().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + getNumericalFeaturesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + map = internalGetNumericalFeatures().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetCategoricalFeatures(), + CategoricalFeaturesDefaultEntryHolder.defaultEntry, + 1); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetNumericalFeatures(), + NumericalFeaturesDefaultEntryHolder.defaultEntry, + 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + entry : internalGetCategoricalFeatures().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + categoricalFeatures__ = + CategoricalFeaturesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, categoricalFeatures__); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + entry : internalGetNumericalFeatures().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + numericalFeatures__ = + NumericalFeaturesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, numericalFeatures__); + } + 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.recommendationengine.v1beta1.FeatureMap)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.FeatureMap other = + (com.google.cloud.recommendationengine.v1beta1.FeatureMap) obj; + + if (!internalGetCategoricalFeatures().equals(other.internalGetCategoricalFeatures())) + return false; + if (!internalGetNumericalFeatures().equals(other.internalGetNumericalFeatures())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetCategoricalFeatures().getMap().isEmpty()) { + hash = (37 * hash) + CATEGORICAL_FEATURES_FIELD_NUMBER; + hash = (53 * hash) + internalGetCategoricalFeatures().hashCode(); + } + if (!internalGetNumericalFeatures().getMap().isEmpty()) { + hash = (37 * hash) + NUMERICAL_FEATURES_FIELD_NUMBER; + hash = (53 * hash) + internalGetNumericalFeatures().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap 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.recommendationengine.v1beta1.FeatureMap parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap 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.recommendationengine.v1beta1.FeatureMap parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap 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.recommendationengine.v1beta1.FeatureMap parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap 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.recommendationengine.v1beta1.FeatureMap parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap 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.recommendationengine.v1beta1.FeatureMap 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; + } + /** + * + * + *
+   * FeatureMap represents extra features that customers want to include in the
+   * recommendation model for catalogs/user events as categorical/numerical
+   * features.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.FeatureMap} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.FeatureMap) + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetCategoricalFeatures(); + case 2: + return internalGetNumericalFeatures(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableCategoricalFeatures(); + case 2: + return internalGetMutableNumericalFeatures(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.class, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.FeatureMap.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(); + internalGetMutableCategoricalFeatures().clear(); + internalGetMutableNumericalFeatures().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Common + .internal_static_google_cloud_recommendationengine_v1beta1_FeatureMap_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap build() { + com.google.cloud.recommendationengine.v1beta1.FeatureMap result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.FeatureMap buildPartial() { + com.google.cloud.recommendationengine.v1beta1.FeatureMap result = + new com.google.cloud.recommendationengine.v1beta1.FeatureMap(this); + int from_bitField0_ = bitField0_; + result.categoricalFeatures_ = internalGetCategoricalFeatures(); + result.categoricalFeatures_.makeImmutable(); + result.numericalFeatures_ = internalGetNumericalFeatures(); + result.numericalFeatures_.makeImmutable(); + 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.recommendationengine.v1beta1.FeatureMap) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.FeatureMap) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.FeatureMap other) { + if (other == com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance()) + return this; + internalGetMutableCategoricalFeatures().mergeFrom(other.internalGetCategoricalFeatures()); + internalGetMutableNumericalFeatures().mergeFrom(other.internalGetNumericalFeatures()); + 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.recommendationengine.v1beta1.FeatureMap parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.FeatureMap) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + categoricalFeatures_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + internalGetCategoricalFeatures() { + if (categoricalFeatures_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CategoricalFeaturesDefaultEntryHolder.defaultEntry); + } + return categoricalFeatures_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + internalGetMutableCategoricalFeatures() { + onChanged(); + ; + if (categoricalFeatures_ == null) { + categoricalFeatures_ = + com.google.protobuf.MapField.newMapField( + CategoricalFeaturesDefaultEntryHolder.defaultEntry); + } + if (!categoricalFeatures_.isMutable()) { + categoricalFeatures_ = categoricalFeatures_.copy(); + } + return categoricalFeatures_; + } + + public int getCategoricalFeaturesCount() { + return internalGetCategoricalFeatures().getMap().size(); + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public boolean containsCategoricalFeatures(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetCategoricalFeatures().getMap().containsKey(key); + } + /** Use {@link #getCategoricalFeaturesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getCategoricalFeatures() { + return getCategoricalFeaturesMap(); + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getCategoricalFeaturesMap() { + return internalGetCategoricalFeatures().getMap(); + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getCategoricalFeaturesOrDefault( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + map = internalGetCategoricalFeatures().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getCategoricalFeaturesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + map = internalGetCategoricalFeatures().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCategoricalFeatures() { + internalGetMutableCategoricalFeatures().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public Builder removeCategoricalFeatures(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableCategoricalFeatures().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getMutableCategoricalFeatures() { + return internalGetMutableCategoricalFeatures().getMutableMap(); + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public Builder putCategoricalFeatures( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableCategoricalFeatures().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Categorical features that can take on one of a limited number of possible
+     * values. Some examples would be the brand/maker of a product, or country of
+     * a customer.
+     * Feature names and values must be UTF-8 encoded strings.
+     * For example: `{ "colors": {"value": ["yellow", "green"]},
+     *                 "sizes": {"value":["S", "M"]}`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + public Builder putAllCategoricalFeatures( + java.util.Map< + java.lang.String, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + values) { + internalGetMutableCategoricalFeatures().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + numericalFeatures_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + internalGetNumericalFeatures() { + if (numericalFeatures_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NumericalFeaturesDefaultEntryHolder.defaultEntry); + } + return numericalFeatures_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + internalGetMutableNumericalFeatures() { + onChanged(); + ; + if (numericalFeatures_ == null) { + numericalFeatures_ = + com.google.protobuf.MapField.newMapField( + NumericalFeaturesDefaultEntryHolder.defaultEntry); + } + if (!numericalFeatures_.isMutable()) { + numericalFeatures_ = numericalFeatures_.copy(); + } + return numericalFeatures_; + } + + public int getNumericalFeaturesCount() { + return internalGetNumericalFeatures().getMap().size(); + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public boolean containsNumericalFeatures(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetNumericalFeatures().getMap().containsKey(key); + } + /** Use {@link #getNumericalFeaturesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getNumericalFeatures() { + return getNumericalFeaturesMap(); + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getNumericalFeaturesMap() { + return internalGetNumericalFeatures().getMap(); + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + getNumericalFeaturesOrDefault( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + map = internalGetNumericalFeatures().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + getNumericalFeaturesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + map = internalGetNumericalFeatures().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearNumericalFeatures() { + internalGetMutableNumericalFeatures().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public Builder removeNumericalFeatures(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableNumericalFeatures().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getMutableNumericalFeatures() { + return internalGetMutableNumericalFeatures().getMutableMap(); + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public Builder putNumericalFeatures( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableNumericalFeatures().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Numerical features. Some examples would be the height/weight of a product,
+     * or age of a customer.
+     * Feature names must be UTF-8 encoded strings.
+     * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+     *                 "heights_cm": {"value":[8.1, 6.4]} }`
+     * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + public Builder putAllNumericalFeatures( + java.util.Map< + java.lang.String, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + values) { + internalGetMutableNumericalFeatures().getMutableMap().putAll(values); + 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.recommendationengine.v1beta1.FeatureMap) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.FeatureMap) + private static final com.google.cloud.recommendationengine.v1beta1.FeatureMap DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.FeatureMap(); + } + + public static com.google.cloud.recommendationengine.v1beta1.FeatureMap getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureMap parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FeatureMap(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.recommendationengine.v1beta1.FeatureMap getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/FeatureMapOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/FeatureMapOrBuilder.java new file mode 100644 index 00000000..5b7daa5a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/FeatureMapOrBuilder.java @@ -0,0 +1,213 @@ +/* + * 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/recommendationengine/v1beta1/common.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface FeatureMapOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.FeatureMap) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + int getCategoricalFeaturesCount(); + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + boolean containsCategoricalFeatures(java.lang.String key); + /** Use {@link #getCategoricalFeaturesMap()} instead. */ + @java.lang.Deprecated + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getCategoricalFeatures(); + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> + getCategoricalFeaturesMap(); + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + getCategoricalFeaturesOrDefault( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList defaultValue); + /** + * + * + *
+   * Categorical features that can take on one of a limited number of possible
+   * values. Some examples would be the brand/maker of a product, or country of
+   * a customer.
+   * Feature names and values must be UTF-8 encoded strings.
+   * For example: `{ "colors": {"value": ["yellow", "green"]},
+   *                 "sizes": {"value":["S", "M"]}`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList getCategoricalFeaturesOrThrow( + java.lang.String key); + + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + int getNumericalFeaturesCount(); + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + boolean containsNumericalFeatures(java.lang.String key); + /** Use {@link #getNumericalFeaturesMap()} instead. */ + @java.lang.Deprecated + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getNumericalFeatures(); + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + java.util.Map< + java.lang.String, com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> + getNumericalFeaturesMap(); + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList getNumericalFeaturesOrDefault( + java.lang.String key, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList defaultValue); + /** + * + * + *
+   * Numerical features. Some examples would be the height/weight of a product,
+   * or age of a customer.
+   * Feature names must be UTF-8 encoded strings.
+   * For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
+   *                 "heights_cm": {"value":[8.1, 6.4]} }`
+   * 
+ * + * + * map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList getNumericalFeaturesOrThrow( + java.lang.String key); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GcsSource.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GcsSource.java new file mode 100644 index 00000000..1fe3a8c3 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GcsSource.java @@ -0,0 +1,818 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Google Cloud Storage location for input content.
+ * format.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsSource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inputUris_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + inputUris_ = inputUris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.GcsSource.class, + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder.class); + } + + public static final int INPUT_URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList inputUris_; + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_; + } + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < inputUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUris_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < inputUris_.size(); i++) { + dataSize += computeStringSizeNoTag(inputUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputUrisList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.GcsSource other = + (com.google.cloud.recommendationengine.v1beta1.GcsSource) obj; + + if (!getInputUrisList().equals(other.getInputUrisList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInputUrisCount() > 0) { + hash = (37 * hash) + INPUT_URIS_FIELD_NUMBER; + hash = (53 * hash) + getInputUrisList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource 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.recommendationengine.v1beta1.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource 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.recommendationengine.v1beta1.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource 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.recommendationengine.v1beta1.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource 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.recommendationengine.v1beta1.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource 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.recommendationengine.v1beta1.GcsSource 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; + } + /** + * + * + *
+   * Google Cloud Storage location for input content.
+   * format.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.GcsSource) + com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.GcsSource.class, + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.GcsSource.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(); + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.GcsSource getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.GcsSource build() { + com.google.cloud.recommendationengine.v1beta1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.GcsSource buildPartial() { + com.google.cloud.recommendationengine.v1beta1.GcsSource result = + new com.google.cloud.recommendationengine.v1beta1.GcsSource(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + inputUris_ = inputUris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputUris_ = inputUris_; + 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.recommendationengine.v1beta1.GcsSource) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.GcsSource other) { + if (other == com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance()) + return this; + if (!other.inputUris_.isEmpty()) { + if (inputUris_.isEmpty()) { + inputUris_ = other.inputUris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputUrisIsMutable(); + inputUris_.addAll(other.inputUris_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.GcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList inputUris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInputUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(inputUris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The inputUris to set. + * @return This builder for chaining. + */ + public Builder setInputUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The inputUris to add. + * @return This builder for chaining. + */ + public Builder addInputUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The inputUris to add. + * @return This builder for chaining. + */ + public Builder addAllInputUris(java.lang.Iterable values) { + ensureInputUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputUris_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInputUris() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URIs to input files. URI can be up to
+     * 2000 characters long. URIs can match the full object path (for example,
+     * gs://bucket/directory/object.json) or a pattern matching one or more
+     * files, such as gs://bucket/directory/*.json. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the inputUris to add. + * @return This builder for chaining. + */ + public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.GcsSource) + private static final com.google.cloud.recommendationengine.v1beta1.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.GcsSource(); + } + + public static com.google.cloud.recommendationengine.v1beta1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsSource(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.recommendationengine.v1beta1.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GcsSourceOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GcsSourceOrBuilder.java new file mode 100644 index 00000000..dbdbb582 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GcsSourceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + java.util.List getInputUrisList(); + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + int getInputUrisCount(); + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + java.lang.String getInputUris(int index); + /** + * + * + *
+   * Required. Google Cloud Storage URIs to input files. URI can be up to
+   * 2000 characters long. URIs can match the full object path (for example,
+   * gs://bucket/directory/object.json) or a pattern matching one or more
+   * files, such as gs://bucket/directory/*.json. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing catalog information](/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + com.google.protobuf.ByteString getInputUrisBytes(int index); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GetCatalogItemRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GetCatalogItemRequest.java new file mode 100644 index 00000000..ae90fcb8 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GetCatalogItemRequest.java @@ -0,0 +1,653 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for GetCatalogItem method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest} + */ +public final class GetCatalogItemRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) + GetCatalogItemRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCatalogItemRequest.newBuilder() to construct. + private GetCatalogItemRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCatalogItemRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCatalogItemRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetCatalogItemRequest( + 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; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.recommendationengine.v1beta1.GetCatalogItemRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest other = + (com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest 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.recommendationengine.v1beta1.GetCatalogItemRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest 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.recommendationengine.v1beta1.GetCatalogItemRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest 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.recommendationengine.v1beta1.GetCatalogItemRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + 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.recommendationengine.v1beta1.GetCatalogItemRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest 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.recommendationengine.v1beta1.GetCatalogItemRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GetCatalogItem method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_GetCatalogItemRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest build() { + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest result = + new com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest(this); + result.name_ = name_; + 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.recommendationengine.v1beta1.GetCatalogItemRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + + @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.recommendationengine.v1beta1.GetCatalogItemRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) + private static final com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCatalogItemRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCatalogItemRequest(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.recommendationengine.v1beta1.GetCatalogItemRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GetCatalogItemRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GetCatalogItemRequestOrBuilder.java new file mode 100644 index 00000000..f7fc3e20 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/GetCatalogItemRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface GetCatalogItemRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Image.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Image.java new file mode 100644 index 00000000..0d2df089 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Image.java @@ -0,0 +1,810 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Catalog item thumbnail/detail image.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.Image} + */ +public final class Image extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.Image) + ImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Image() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Image(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Image( + 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(); + + uri_ = s; + break; + } + case 16: + { + height_ = input.readInt32(); + break; + } + case 24: + { + width_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.Image.class, + com.google.cloud.recommendationengine.v1beta1.Image.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Required. URL of the image with a length limit of 5 KiB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URL of the image with a length limit of 5 KiB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private int height_; + /** + * + * + *
+   * Optional. Height of the image in number of pixels.
+   * 
+ * + * int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The height. + */ + public int getHeight() { + return height_; + } + + public static final int WIDTH_FIELD_NUMBER = 3; + private int width_; + /** + * + * + *
+   * Optional. Width of the image in number of pixels.
+   * 
+ * + * int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The width. + */ + public int getWidth() { + return width_; + } + + 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 (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (height_ != 0) { + output.writeInt32(2, height_); + } + if (width_ != 0) { + output.writeInt32(3, width_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, height_); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, width_); + } + 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.recommendationengine.v1beta1.Image)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.Image other = + (com.google.cloud.recommendationengine.v1beta1.Image) obj; + + if (!getUri().equals(other.getUri())) return false; + if (getHeight() != other.getHeight()) return false; + if (getWidth() != other.getWidth()) 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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.Image parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image 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.recommendationengine.v1beta1.Image parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image 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.recommendationengine.v1beta1.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image 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.recommendationengine.v1beta1.Image parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image 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.recommendationengine.v1beta1.Image parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image 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.recommendationengine.v1beta1.Image 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; + } + /** + * + * + *
+   * Catalog item thumbnail/detail image.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.Image} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.Image) + com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.Image.class, + com.google.cloud.recommendationengine.v1beta1.Image.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.Image.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(); + uri_ = ""; + + height_ = 0; + + width_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_Image_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.Image getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.Image.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.Image build() { + com.google.cloud.recommendationengine.v1beta1.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.Image buildPartial() { + com.google.cloud.recommendationengine.v1beta1.Image result = + new com.google.cloud.recommendationengine.v1beta1.Image(this); + result.uri_ = uri_; + result.height_ = height_; + result.width_ = width_; + 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.recommendationengine.v1beta1.Image) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.Image) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.Image other) { + if (other == com.google.cloud.recommendationengine.v1beta1.Image.getDefaultInstance()) + return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getHeight() != 0) { + setHeight(other.getHeight()); + } + if (other.getWidth() != 0) { + setWidth(other.getWidth()); + } + 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.recommendationengine.v1beta1.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.Image) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Required. URL of the image with a length limit of 5 KiB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URL of the image with a length limit of 5 KiB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URL of the image with a length limit of 5 KiB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL of the image with a length limit of 5 KiB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL of the image with a length limit of 5 KiB.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private int height_; + /** + * + * + *
+     * Optional. Height of the image in number of pixels.
+     * 
+ * + * int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The height. + */ + public int getHeight() { + return height_; + } + /** + * + * + *
+     * Optional. Height of the image in number of pixels.
+     * 
+ * + * int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(int value) { + + height_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Height of the image in number of pixels.
+     * 
+ * + * int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHeight() { + + height_ = 0; + onChanged(); + return this; + } + + private int width_; + /** + * + * + *
+     * Optional. Width of the image in number of pixels.
+     * 
+ * + * int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The width. + */ + public int getWidth() { + return width_; + } + /** + * + * + *
+     * Optional. Width of the image in number of pixels.
+     * 
+ * + * int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(int value) { + + width_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Width of the image in number of pixels.
+     * 
+ * + * int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearWidth() { + + width_ = 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.recommendationengine.v1beta1.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.Image) + private static final com.google.cloud.recommendationengine.v1beta1.Image DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.Image(); + } + + public static com.google.cloud.recommendationengine.v1beta1.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(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.recommendationengine.v1beta1.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImageOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImageOrBuilder.java new file mode 100644 index 00000000..42c2d31e --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImageOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.Image) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. URL of the image with a length limit of 5 KiB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Required. URL of the image with a length limit of 5 KiB.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Optional. Height of the image in number of pixels.
+   * 
+ * + * int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The height. + */ + int getHeight(); + + /** + * + * + *
+   * Optional. Width of the image in number of pixels.
+   * 
+ * + * int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The width. + */ + int getWidth(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Import.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Import.java new file mode 100644 index 00000000..cd364a4c --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/Import.java @@ -0,0 +1,261 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class Import { + private Import() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/recommendationengine/v1be" + + "ta1/import.proto\022)google.cloud.recommend" + + "ationengine.v1beta1\032\037google/api/field_be" + + "havior.proto\0327google/cloud/recommendatio" + + "nengine/v1beta1/catalog.proto\032:google/cl" + + "oud/recommendationengine/v1beta1/user_ev" + + "ent.proto\032\037google/protobuf/timestamp.pro" + + "to\032\027google/rpc/status.proto\032\034google/api/" + + "annotations.proto\"$\n\tGcsSource\022\027\n\ninput_" + + "uris\030\001 \003(\tB\003\340A\002\"i\n\023CatalogInlineSource\022R" + + "\n\rcatalog_items\030\001 \003(\01326.google.cloud.rec" + + "ommendationengine.v1beta1.CatalogItemB\003\340" + + "A\001\"g\n\025UserEventInlineSource\022N\n\013user_even" + + "ts\030\001 \003(\01324.google.cloud.recommendationen" + + "gine.v1beta1.UserEventB\003\340A\001\"9\n\022ImportErr" + + "orsConfig\022\024\n\ngcs_prefix\030\001 \001(\tH\000B\r\n\013desti" + + "nation\"\367\001\n\031ImportCatalogItemsRequest\022\023\n\006" + + "parent\030\001 \001(\tB\003\340A\002\022\027\n\nrequest_id\030\002 \001(\tB\003\340" + + "A\001\022Q\n\014input_config\030\003 \001(\01326.google.cloud." + + "recommendationengine.v1beta1.InputConfig" + + "B\003\340A\002\022Y\n\rerrors_config\030\004 \001(\0132=.google.cl" + + "oud.recommendationengine.v1beta1.ImportE" + + "rrorsConfigB\003\340A\001\"\365\001\n\027ImportUserEventsReq" + + "uest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\027\n\nrequest_id\030" + + "\002 \001(\tB\003\340A\001\022Q\n\014input_config\030\003 \001(\01326.googl" + + "e.cloud.recommendationengine.v1beta1.Inp" + + "utConfigB\003\340A\002\022Y\n\rerrors_config\030\004 \001(\0132=.g" + + "oogle.cloud.recommendationengine.v1beta1" + + ".ImportErrorsConfigB\003\340A\001\"\252\002\n\013InputConfig" + + "\022_\n\025catalog_inline_source\030\001 \001(\0132>.google" + + ".cloud.recommendationengine.v1beta1.Cata" + + "logInlineSourceH\000\022J\n\ngcs_source\030\002 \001(\01324." + + "google.cloud.recommendationengine.v1beta" + + "1.GcsSourceH\000\022d\n\030user_event_inline_sourc" + + "e\030\003 \001(\0132@.google.cloud.recommendationeng" + + "ine.v1beta1.UserEventInlineSourceH\000B\010\n\006s" + + "ource\"\314\001\n\016ImportMetadata\022\026\n\016operation_na" + + "me\030\005 \001(\t\022\022\n\nrequest_id\030\003 \001(\t\022/\n\013create_t" + + "ime\030\004 \001(\0132\032.google.protobuf.Timestamp\022\025\n" + + "\rsuccess_count\030\001 \001(\003\022\025\n\rfailure_count\030\002 " + + "\001(\003\022/\n\013update_time\030\006 \001(\0132\032.google.protob" + + "uf.Timestamp\"\235\001\n\032ImportCatalogItemsRespo" + + "nse\022)\n\rerror_samples\030\001 \003(\0132\022.google.rpc." + + "Status\022T\n\rerrors_config\030\002 \001(\0132=.google.c" + + "loud.recommendationengine.v1beta1.Import" + + "ErrorsConfig\"\366\001\n\030ImportUserEventsRespons" + + "e\022)\n\rerror_samples\030\001 \003(\0132\022.google.rpc.St" + + "atus\022T\n\rerrors_config\030\002 \001(\0132=.google.clo" + + "ud.recommendationengine.v1beta1.ImportEr" + + "rorsConfig\022Y\n\016import_summary\030\003 \001(\0132A.goo" + + "gle.cloud.recommendationengine.v1beta1.U" + + "serEventImportSummary\"T\n\026UserEventImport" + + "Summary\022\033\n\023joined_events_count\030\001 \001(\003\022\035\n\025" + + "unjoined_events_count\030\002 \001(\003B\304\001\n-com.goog" + + "le.cloud.recommendationengine.v1beta1P\001Z" + + "]google.golang.org/genproto/googleapis/c" + + "loud/recommendationengine/v1beta1;recomm" + + "endationengine\242\002\005RECAI\252\002)Google.Cloud.Re" + + "commendationEngine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Catalog.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_GcsSource_descriptor, + new java.lang.String[] { + "InputUris", + }); + internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_CatalogInlineSource_descriptor, + new java.lang.String[] { + "CatalogItems", + }); + internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_descriptor, + new java.lang.String[] { + "UserEvents", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_descriptor, + new java.lang.String[] { + "GcsPrefix", "Destination", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_descriptor, + new java.lang.String[] { + "Parent", "RequestId", "InputConfig", "ErrorsConfig", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "RequestId", "InputConfig", "ErrorsConfig", + }); + internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_descriptor, + new java.lang.String[] { + "CatalogInlineSource", "GcsSource", "UserEventInlineSource", "Source", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_descriptor, + new java.lang.String[] { + "OperationName", + "RequestId", + "CreateTime", + "SuccessCount", + "FailureCount", + "UpdateTime", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", "ImportSummary", + }); + internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_descriptor, + new java.lang.String[] { + "JoinedEventsCount", "UnjoinedEventsCount", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Catalog.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsRequest.java new file mode 100644 index 00000000..79533863 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsRequest.java @@ -0,0 +1,1459 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for Import methods.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest} + */ +public final class ImportCatalogItemsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) + ImportCatalogItemsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCatalogItemsRequest.newBuilder() to construct. + private ImportCatalogItemsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCatalogItemsRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCatalogItemsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCatalogItemsRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 26: + { + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.InputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder subBuilder = + null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency and used for request deduplication.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency and used for request deduplication.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.recommendationengine.v1beta1.InputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder + getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (inputConfig_ != null) { + output.writeMessage(3, getInputConfig()); + } + if (errorsConfig_ != null) { + output.writeMessage(4, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInputConfig()); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getErrorsConfig()); + } + 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.recommendationengine.v1beta1.ImportCatalogItemsRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest other = + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest 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.recommendationengine.v1beta1.ImportCatalogItemsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest 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.recommendationengine.v1beta1.ImportCatalogItemsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest 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.recommendationengine.v1beta1.ImportCatalogItemsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + 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.recommendationengine.v1beta1.ImportCatalogItemsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest 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.recommendationengine.v1beta1.ImportCatalogItemsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for Import methods.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.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(); + parent_ = ""; + + requestId_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest build() { + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest result = + new com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest(this); + result.parent_ = parent_; + result.requestId_ = requestId_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.recommendationengine.v1beta1.ImportCatalogItemsRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.recommendationengine.v1beta1.ImportCatalogItemsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency and used for request deduplication.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency and used for request deduplication.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency and used for request deduplication.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency and used for request deduplication.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency and used for request deduplication.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.InputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.InputConfig, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.recommendationengine.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig( + com.google.cloud.recommendationengine.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.recommendationengine.v1beta1.InputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder + getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder + getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.InputConfig, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.InputConfig, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.newBuilder( + errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder + getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.recommendationengine.v1beta1.ImportCatalogItemsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) + private static final com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCatalogItemsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCatalogItemsRequest(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.recommendationengine.v1beta1.ImportCatalogItemsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsRequestOrBuilder.java new file mode 100644 index 00000000..643b93ec --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImportCatalogItemsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency and used for request deduplication.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency and used for request deduplication.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.recommendationengine.v1beta1.InputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorsConfig. + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsResponse.java new file mode 100644 index 00000000..d01ea094 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsResponse.java @@ -0,0 +1,1235 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response of the ImportCatalogItemsRequest. If the long running
+ * operation is done, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse} + */ +public final class ImportCatalogItemsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) + ImportCatalogItemsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCatalogItemsResponse.newBuilder() to construct. + private ImportCatalogItemsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCatalogItemsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCatalogItemsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCatalogItemsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder subBuilder = + null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + 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 < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.recommendationengine.v1beta1.ImportCatalogItemsResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse other = + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse 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.recommendationengine.v1beta1.ImportCatalogItemsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse 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.recommendationengine.v1beta1.ImportCatalogItemsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse 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.recommendationengine.v1beta1.ImportCatalogItemsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + 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.recommendationengine.v1beta1.ImportCatalogItemsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse 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.recommendationengine.v1beta1.ImportCatalogItemsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the ImportCatalogItemsRequest. If the long running
+   * operation is done, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportCatalogItemsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse build() { + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse result = + new com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.recommendationengine.v1beta1.ImportCatalogItemsResponse) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + .getDefaultInstance()) return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.recommendationengine.v1beta1.ImportCatalogItemsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.newBuilder( + errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder + getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.recommendationengine.v1beta1.ImportCatalogItemsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) + private static final com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCatalogItemsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCatalogItemsResponse(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.recommendationengine.v1beta1.ImportCatalogItemsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsResponseOrBuilder.java new file mode 100644 index 00000000..bede3c5c --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportCatalogItemsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImportCatalogItemsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportErrorsConfig.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportErrorsConfig.java new file mode 100644 index 00000000..51786d80 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportErrorsConfig.java @@ -0,0 +1,764 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Configuration of destination for Import related errors.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportErrorsConfig} + */ +public final class ImportErrorsConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) + ImportErrorsConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportErrorsConfig.newBuilder() to construct. + private ImportErrorsConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportErrorsConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportErrorsConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportErrorsConfig( + 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(); + destinationCase_ = 1; + destination_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.class, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_PREFIX(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(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 DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_PREFIX; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_PREFIX_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Import errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Import errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (destinationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + 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.recommendationengine.v1beta1.ImportErrorsConfig)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig other = + (com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) 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 (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig 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.recommendationengine.v1beta1.ImportErrorsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig 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.recommendationengine.v1beta1.ImportErrorsConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig 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.recommendationengine.v1beta1.ImportErrorsConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig 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.recommendationengine.v1beta1.ImportErrorsConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig 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.recommendationengine.v1beta1.ImportErrorsConfig 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; + } + /** + * + * + *
+   * Configuration of destination for Import related errors.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportErrorsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.class, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.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(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig build() { + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig result = + new com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig(this); + if (destinationCase_ == 1) { + result.destination_ = destination_; + } + result.destinationCase_ = destinationCase_; + 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.recommendationengine.v1beta1.ImportErrorsConfig) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_PREFIX: + { + destinationCase_ = 1; + destination_ = other.destination_; + onChanged(); + break; + } + case DESTINATION_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.recommendationengine.v1beta1.ImportErrorsConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Import errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Import errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Import errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationCase_ = 1; + destination_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Import errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcsPrefix() { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Import errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The bytes for gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationCase_ = 1; + destination_ = 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.recommendationengine.v1beta1.ImportErrorsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) + private static final com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportErrorsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportErrorsConfig(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.recommendationengine.v1beta1.ImportErrorsConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportErrorsConfigOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportErrorsConfigOrBuilder.java new file mode 100644 index 00000000..a3017672 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportErrorsConfigOrBuilder.java @@ -0,0 +1,59 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImportErrorsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ImportErrorsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Import errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + java.lang.String getGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Import errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + com.google.protobuf.ByteString getGcsPrefixBytes(); + + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.DestinationCase + getDestinationCase(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportMetadata.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportMetadata.java new file mode 100644 index 00000000..b947f91a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportMetadata.java @@ -0,0 +1,1550 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Metadata related to the progress of the Import operation. This will be
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportMetadata} + */ +public final class ImportMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ImportMetadata) + ImportMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportMetadata.newBuilder() to construct. + private ImportMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportMetadata() { + operationName_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportMetadata( + 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: + { + successCount_ = input.readInt64(); + break; + } + case 16: + { + failureCount_ = input.readInt64(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + operationName_ = s; + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportMetadata.class, + com.google.cloud.recommendationengine.v1beta1.ImportMetadata.Builder.class); + } + + public static final int OPERATION_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object operationName_; + /** + * + * + *
+   * Name of the operation.
+   * 
+ * + * string operation_name = 5; + * + * @return The operationName. + */ + public java.lang.String getOperationName() { + java.lang.Object ref = operationName_; + 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(); + operationName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the operation.
+   * 
+ * + * string operation_name = 5; + * + * @return The bytes for operationName. + */ + public com.google.protobuf.ByteString getOperationNameBytes() { + java.lang.Object ref = operationName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId that
+   * was passed in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId that
+   * was passed in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 1; + private long successCount_; + /** + * + * + *
+   * Count of entries that were processed successfully.
+   * 
+ * + * int64 success_count = 1; + * + * @return The successCount. + */ + public long getSuccessCount() { + return successCount_; + } + + public static final int FAILURE_COUNT_FIELD_NUMBER = 2; + private long failureCount_; + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 2; + * + * @return The failureCount. + */ + public long getFailureCount() { + return failureCount_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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 (successCount_ != 0L) { + output.writeInt64(1, successCount_); + } + if (failureCount_ != 0L) { + output.writeInt64(2, failureCount_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (!getOperationNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, operationName_); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (successCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, successCount_); + } + if (failureCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, failureCount_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (!getOperationNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, operationName_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + 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.recommendationengine.v1beta1.ImportMetadata)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ImportMetadata other = + (com.google.cloud.recommendationengine.v1beta1.ImportMetadata) obj; + + if (!getOperationName().equals(other.getOperationName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (getSuccessCount() != other.getSuccessCount()) return false; + if (getFailureCount() != other.getFailureCount()) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) 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) + OPERATION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOperationName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + SUCCESS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSuccessCount()); + hash = (37 * hash) + FAILURE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailureCount()); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata 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.recommendationengine.v1beta1.ImportMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata 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.recommendationengine.v1beta1.ImportMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata 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.recommendationengine.v1beta1.ImportMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata 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.recommendationengine.v1beta1.ImportMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata 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.recommendationengine.v1beta1.ImportMetadata 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; + } + /** + * + * + *
+   * Metadata related to the progress of the Import operation. This will be
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ImportMetadata) + com.google.cloud.recommendationengine.v1beta1.ImportMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportMetadata.class, + com.google.cloud.recommendationengine.v1beta1.ImportMetadata.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.ImportMetadata.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(); + operationName_ = ""; + + requestId_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + successCount_ = 0L; + + failureCount_ = 0L; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportMetadata + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ImportMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportMetadata build() { + com.google.cloud.recommendationengine.v1beta1.ImportMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportMetadata buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ImportMetadata result = + new com.google.cloud.recommendationengine.v1beta1.ImportMetadata(this); + result.operationName_ = operationName_; + result.requestId_ = requestId_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.successCount_ = successCount_; + result.failureCount_ = failureCount_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.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.recommendationengine.v1beta1.ImportMetadata) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.ImportMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.ImportMetadata other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ImportMetadata.getDefaultInstance()) + return this; + if (!other.getOperationName().isEmpty()) { + operationName_ = other.operationName_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.getSuccessCount() != 0L) { + setSuccessCount(other.getSuccessCount()); + } + if (other.getFailureCount() != 0L) { + setFailureCount(other.getFailureCount()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.recommendationengine.v1beta1.ImportMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ImportMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object operationName_ = ""; + /** + * + * + *
+     * Name of the operation.
+     * 
+ * + * string operation_name = 5; + * + * @return The operationName. + */ + public java.lang.String getOperationName() { + java.lang.Object ref = operationName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the operation.
+     * 
+ * + * string operation_name = 5; + * + * @return The bytes for operationName. + */ + public com.google.protobuf.ByteString getOperationNameBytes() { + java.lang.Object ref = operationName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the operation.
+     * 
+ * + * string operation_name = 5; + * + * @param value The operationName to set. + * @return This builder for chaining. + */ + public Builder setOperationName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the operation.
+     * 
+ * + * string operation_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearOperationName() { + + operationName_ = getDefaultInstance().getOperationName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the operation.
+     * 
+ * + * string operation_name = 5; + * + * @param value The bytes for operationName to set. + * @return This builder for chaining. + */ + public Builder setOperationNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationName_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId that
+     * was passed in the request.
+     * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId that
+     * was passed in the request.
+     * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId that
+     * was passed in the request.
+     * 
+ * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId that
+     * was passed in the request.
+     * 
+ * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Id of the request / operation. This is parroting back the requestId that
+     * was passed in the request.
+     * 
+ * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private long successCount_; + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 1; + * + * @return The successCount. + */ + public long getSuccessCount() { + return successCount_; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 1; + * + * @param value The successCount to set. + * @return This builder for chaining. + */ + public Builder setSuccessCount(long value) { + + successCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + + successCount_ = 0L; + onChanged(); + return this; + } + + private long failureCount_; + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 2; + * + * @return The failureCount. + */ + public long getFailureCount() { + return failureCount_; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 2; + * + * @param value The failureCount to set. + * @return This builder for chaining. + */ + public Builder setFailureCount(long value) { + + failureCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + + failureCount_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @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.recommendationengine.v1beta1.ImportMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ImportMetadata) + private static final com.google.cloud.recommendationengine.v1beta1.ImportMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ImportMetadata(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportMetadata(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.recommendationengine.v1beta1.ImportMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportMetadataOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportMetadataOrBuilder.java new file mode 100644 index 00000000..9c231add --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportMetadataOrBuilder.java @@ -0,0 +1,176 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImportMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ImportMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the operation.
+   * 
+ * + * string operation_name = 5; + * + * @return The operationName. + */ + java.lang.String getOperationName(); + /** + * + * + *
+   * Name of the operation.
+   * 
+ * + * string operation_name = 5; + * + * @return The bytes for operationName. + */ + com.google.protobuf.ByteString getOperationNameBytes(); + + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId that
+   * was passed in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Id of the request / operation. This is parroting back the requestId that
+   * was passed in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Count of entries that were processed successfully.
+   * 
+ * + * int64 success_count = 1; + * + * @return The successCount. + */ + long getSuccessCount(); + + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 2; + * + * @return The failureCount. + */ + long getFailureCount(); + + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsRequest.java new file mode 100644 index 00000000..968cf5f7 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsRequest.java @@ -0,0 +1,1469 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for the ImportUserEvents request.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest} + */ +public final class ImportUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) + ImportUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsRequest.newBuilder() to construct. + private ImportUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportUserEventsRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 26: + { + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.InputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder subBuilder = + null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency for expensive long running operations.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response. Note that
+   * this field must not be set if the desired input config is
+   * catalog_inline_source.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency for expensive long running operations.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response. Note that
+   * this field must not be set if the desired input config is
+   * catalog_inline_source.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.recommendationengine.v1beta1.InputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder + getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (inputConfig_ != null) { + output.writeMessage(3, getInputConfig()); + } + if (errorsConfig_ != null) { + output.writeMessage(4, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInputConfig()); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getErrorsConfig()); + } + 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.recommendationengine.v1beta1.ImportUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest other = + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest 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.recommendationengine.v1beta1.ImportUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest 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.recommendationengine.v1beta1.ImportUserEventsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest 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.recommendationengine.v1beta1.ImportUserEventsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + 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.recommendationengine.v1beta1.ImportUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest 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.recommendationengine.v1beta1.ImportUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the ImportUserEvents request.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.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(); + parent_ = ""; + + requestId_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest build() { + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest result = + new com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest(this); + result.parent_ = parent_; + result.requestId_ = requestId_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.recommendationengine.v1beta1.ImportUserEventsRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.recommendationengine.v1beta1.ImportUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency for expensive long running operations.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response. Note that
+     * this field must not be set if the desired input config is
+     * catalog_inline_source.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency for expensive long running operations.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response. Note that
+     * this field must not be set if the desired input config is
+     * catalog_inline_source.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency for expensive long running operations.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response. Note that
+     * this field must not be set if the desired input config is
+     * catalog_inline_source.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency for expensive long running operations.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response. Note that
+     * this field must not be set if the desired input config is
+     * catalog_inline_source.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique identifier provided by client, within the ancestor
+     * dataset scope. Ensures idempotency for expensive long running operations.
+     * Server-generated if unspecified. Up to 128 characters long. This is
+     * returned as google.longrunning.Operation.name in the response. Note that
+     * this field must not be set if the desired input config is
+     * catalog_inline_source.
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.InputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.InputConfig, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.recommendationengine.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig( + com.google.cloud.recommendationengine.v1beta1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.recommendationengine.v1beta1.InputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder + getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder + getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.InputConfig, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.InputConfig, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.newBuilder( + errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder + getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Optional. The desired location of errors incurred during the Import.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.recommendationengine.v1beta1.ImportUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) + private static final com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportUserEventsRequest(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.recommendationengine.v1beta1.ImportUserEventsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..e0c8386b --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsRequestOrBuilder.java @@ -0,0 +1,168 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImportUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency for expensive long running operations.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response. Note that
+   * this field must not be set if the desired input config is
+   * catalog_inline_source.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. Unique identifier provided by client, within the ancestor
+   * dataset scope. Ensures idempotency for expensive long running operations.
+   * Server-generated if unspecified. Up to 128 characters long. This is
+   * returned as google.longrunning.Operation.name in the response. Note that
+   * this field must not be set if the desired input config is
+   * catalog_inline_source.
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.recommendationengine.v1beta1.InputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The errorsConfig. + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Optional. The desired location of errors incurred during the Import.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsResponse.java new file mode 100644 index 00000000..48732a43 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsResponse.java @@ -0,0 +1,1541 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response of the ImportUserEventsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse} + */ +public final class ImportUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) + ImportUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsResponse.newBuilder() to construct. + private ImportUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportUserEventsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder subBuilder = + null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder + subBuilder = null; + if (importSummary_ != null) { + subBuilder = importSummary_.toBuilder(); + } + importSummary_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(importSummary_); + importSummary_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + public static final int IMPORT_SUMMARY_FIELD_NUMBER = 3; + private com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary importSummary_; + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + * + * @return Whether the importSummary field is set. + */ + public boolean hasImportSummary() { + return importSummary_ != null; + } + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + * + * @return The importSummary. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary getImportSummary() { + return importSummary_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder() { + return getImportSummary(); + } + + 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 < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + if (importSummary_ != null) { + output.writeMessage(3, getImportSummary()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + if (importSummary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getImportSummary()); + } + 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.recommendationengine.v1beta1.ImportUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse other = + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasImportSummary() != other.hasImportSummary()) return false; + if (hasImportSummary()) { + if (!getImportSummary().equals(other.getImportSummary())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasImportSummary()) { + hash = (37 * hash) + IMPORT_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getImportSummary().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse 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.recommendationengine.v1beta1.ImportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse 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.recommendationengine.v1beta1.ImportUserEventsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse 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.recommendationengine.v1beta1.ImportUserEventsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + 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.recommendationengine.v1beta1.ImportUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse 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.recommendationengine.v1beta1.ImportUserEventsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the ImportUserEventsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + if (importSummaryBuilder_ == null) { + importSummary_ = null; + } else { + importSummary_ = null; + importSummaryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse build() { + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse result = + new com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.build(); + } + if (importSummaryBuilder_ == null) { + result.importSummary_ = importSummary_; + } else { + result.importSummary_ = importSummaryBuilder_.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.recommendationengine.v1beta1.ImportUserEventsResponse) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + .getDefaultInstance()) return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasImportSummary()) { + mergeImportSummary(other.getImportSummary()); + } + 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.recommendationengine.v1beta1.ImportUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig( + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.newBuilder( + errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder + getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig.Builder, + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary importSummary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder> + importSummaryBuilder_; + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + * + * @return Whether the importSummary field is set. + */ + public boolean hasImportSummary() { + return importSummaryBuilder_ != null || importSummary_ != null; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + * + * @return The importSummary. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary getImportSummary() { + if (importSummaryBuilder_ == null) { + return importSummary_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + .getDefaultInstance() + : importSummary_; + } else { + return importSummaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public Builder setImportSummary( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary value) { + if (importSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importSummary_ = value; + onChanged(); + } else { + importSummaryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public Builder setImportSummary( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder + builderForValue) { + if (importSummaryBuilder_ == null) { + importSummary_ = builderForValue.build(); + onChanged(); + } else { + importSummaryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public Builder mergeImportSummary( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary value) { + if (importSummaryBuilder_ == null) { + if (importSummary_ != null) { + importSummary_ = + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.newBuilder( + importSummary_) + .mergeFrom(value) + .buildPartial(); + } else { + importSummary_ = value; + } + onChanged(); + } else { + importSummaryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public Builder clearImportSummary() { + if (importSummaryBuilder_ == null) { + importSummary_ = null; + onChanged(); + } else { + importSummary_ = null; + importSummaryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder + getImportSummaryBuilder() { + + onChanged(); + return getImportSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder() { + if (importSummaryBuilder_ != null) { + return importSummaryBuilder_.getMessageOrBuilder(); + } else { + return importSummary_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + .getDefaultInstance() + : importSummary_; + } + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder> + getImportSummaryFieldBuilder() { + if (importSummaryBuilder_ == null) { + importSummaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder>( + getImportSummary(), getParentForChildren(), isClean()); + importSummary_ = null; + } + return importSummaryBuilder_; + } + + @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.recommendationengine.v1beta1.ImportUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) + private static final com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportUserEventsResponse(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.recommendationengine.v1beta1.ImportUserEventsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..c960840c --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ImportUserEventsResponseOrBuilder.java @@ -0,0 +1,154 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ImportUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + com.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigOrBuilder + getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + * + * @return Whether the importSummary field is set. + */ + boolean hasImportSummary(); + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + * + * @return The importSummary. + */ + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary getImportSummary(); + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/InputConfig.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/InputConfig.java new file mode 100644 index 00000000..789a7fc3 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/InputConfig.java @@ -0,0 +1,1521 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * The input config source.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.InputConfig} + */ +public final class InputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.InputConfig) + InputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputConfig.newBuilder() to construct. + private InputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InputConfig( + 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.recommendationengine.v1beta1.CatalogInlineSource.Builder subBuilder = + null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_) + .toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = + ((com.google.cloud.recommendationengine.v1beta1.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.GcsSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 26: + { + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder + subBuilder = null; + if (sourceCase_ == 3) { + subBuilder = + ((com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_) + .toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 3; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.InputConfig.class, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CATALOG_INLINE_SOURCE(1), + GCS_SOURCE(2), + USER_EVENT_INLINE_SOURCE(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return CATALOG_INLINE_SOURCE; + case 2: + return GCS_SOURCE; + case 3: + return USER_EVENT_INLINE_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int CATALOG_INLINE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The Inline source for the input content for Catalog items.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + * + * @return Whether the catalogInlineSource field is set. + */ + public boolean hasCatalogInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * The Inline source for the input content for Catalog items.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + * + * @return The catalogInlineSource. + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + getCatalogInlineSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Inline source for the input content for Catalog items.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder + getCatalogInlineSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + public com.google.cloud.recommendationengine.v1beta1.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } + + public static final int USER_EVENT_INLINE_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + * + * @return Whether the userEventInlineSource field is set. + */ + public boolean hasUserEventInlineSource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + * + * @return The userEventInlineSource. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + getUserEventInlineSource() { + if (sourceCase_ == 3) { + return (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.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 (sourceCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_); + } + 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.recommendationengine.v1beta1.InputConfig)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.InputConfig other = + (com.google.cloud.recommendationengine.v1beta1.InputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getCatalogInlineSource().equals(other.getCatalogInlineSource())) return false; + break; + case 2: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 3: + if (!getUserEventInlineSource().equals(other.getUserEventInlineSource())) 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 (sourceCase_) { + case 1: + hash = (37 * hash) + CATALOG_INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getCatalogInlineSource().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 3: + hash = (37 * hash) + USER_EVENT_INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getUserEventInlineSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig 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.recommendationengine.v1beta1.InputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig 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.recommendationengine.v1beta1.InputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig 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.recommendationengine.v1beta1.InputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig 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.recommendationengine.v1beta1.InputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig 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.recommendationengine.v1beta1.InputConfig 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 input config source.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.InputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.InputConfig) + com.google.cloud.recommendationengine.v1beta1.InputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.InputConfig.class, + com.google.cloud.recommendationengine.v1beta1.InputConfig.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.InputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_InputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.InputConfig getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.InputConfig build() { + com.google.cloud.recommendationengine.v1beta1.InputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.InputConfig buildPartial() { + com.google.cloud.recommendationengine.v1beta1.InputConfig result = + new com.google.cloud.recommendationengine.v1beta1.InputConfig(this); + if (sourceCase_ == 1) { + if (catalogInlineSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = catalogInlineSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + if (sourceCase_ == 3) { + if (userEventInlineSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = userEventInlineSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.recommendationengine.v1beta1.InputConfig) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.InputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.InputConfig other) { + if (other == com.google.cloud.recommendationengine.v1beta1.InputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case CATALOG_INLINE_SOURCE: + { + mergeCatalogInlineSource(other.getCatalogInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case USER_EVENT_INLINE_SOURCE: + { + mergeUserEventInlineSource(other.getUserEventInlineSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.InputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.InputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder> + catalogInlineSourceBuilder_; + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + * + * @return Whether the catalogInlineSource field is set. + */ + public boolean hasCatalogInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + * + * @return The catalogInlineSource. + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + getCatalogInlineSource() { + if (catalogInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + .getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return catalogInlineSourceBuilder_.getMessage(); + } + return com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public Builder setCatalogInlineSource( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource value) { + if (catalogInlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + catalogInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public Builder setCatalogInlineSource( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder builderForValue) { + if (catalogInlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + catalogInlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public Builder mergeCatalogInlineSource( + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource value) { + if (catalogInlineSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ + != com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + .getDefaultInstance()) { + source_ = + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.newBuilder( + (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + catalogInlineSourceBuilder_.mergeFrom(value); + } + catalogInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public Builder clearCatalogInlineSource() { + if (catalogInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + catalogInlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder + getCatalogInlineSourceBuilder() { + return getCatalogInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder + getCatalogInlineSourceOrBuilder() { + if ((sourceCase_ == 1) && (catalogInlineSourceBuilder_ != null)) { + return catalogInlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for Catalog items.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder> + getCatalogInlineSourceFieldBuilder() { + if (catalogInlineSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource + .getDefaultInstance(); + } + catalogInlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder>( + (com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return catalogInlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.GcsSource, + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder, + com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + public com.google.cloud.recommendationengine.v1beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.recommendationengine.v1beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource( + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.recommendationengine.v1beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ + != com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.recommendationengine.v1beta1.GcsSource.newBuilder( + (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsSourceBuilder_.mergeFrom(value); + } + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + public com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder + getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.GcsSource, + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder, + com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.recommendationengine.v1beta1.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.GcsSource, + com.google.cloud.recommendationengine.v1beta1.GcsSource.Builder, + com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder>( + (com.google.cloud.recommendationengine.v1beta1.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder> + userEventInlineSourceBuilder_; + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + * + * @return Whether the userEventInlineSource field is set. + */ + public boolean hasUserEventInlineSource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + * + * @return The userEventInlineSource. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + getUserEventInlineSource() { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return userEventInlineSourceBuilder_.getMessage(); + } + return com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public Builder setUserEventInlineSource( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource value) { + if (userEventInlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + userEventInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public Builder setUserEventInlineSource( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder + builderForValue) { + if (userEventInlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + userEventInlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public Builder mergeUserEventInlineSource( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource value) { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ + != com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance()) { + source_ = + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.newBuilder( + (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + userEventInlineSourceBuilder_.mergeFrom(value); + } + userEventInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public Builder clearUserEventInlineSource() { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + userEventInlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder + getUserEventInlineSourceBuilder() { + return getUserEventInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder() { + if ((sourceCase_ == 3) && (userEventInlineSourceBuilder_ != null)) { + return userEventInlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_; + } + return com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder> + getUserEventInlineSourceFieldBuilder() { + if (userEventInlineSourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance(); + } + userEventInlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder>( + (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + ; + return userEventInlineSourceBuilder_; + } + + @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.recommendationengine.v1beta1.InputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.InputConfig) + private static final com.google.cloud.recommendationengine.v1beta1.InputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.InputConfig(); + } + + public static com.google.cloud.recommendationengine.v1beta1.InputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InputConfig(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.recommendationengine.v1beta1.InputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/InputConfigOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/InputConfigOrBuilder.java new file mode 100644 index 00000000..03a77960 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/InputConfigOrBuilder.java @@ -0,0 +1,143 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface InputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.InputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Inline source for the input content for Catalog items.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + * + * @return Whether the catalogInlineSource field is set. + */ + boolean hasCatalogInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for Catalog items.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + * + * @return The catalogInlineSource. + */ + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSource getCatalogInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for Catalog items.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceOrBuilder + getCatalogInlineSourceOrBuilder(); + + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.recommendationengine.v1beta1.GcsSource getGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + */ + com.google.cloud.recommendationengine.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + * + * @return Whether the userEventInlineSource field is set. + */ + boolean hasUserEventInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + * + * @return The userEventInlineSource. + */ + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource getUserEventInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder(); + + public com.google.cloud.recommendationengine.v1beta1.InputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsRequest.java new file mode 100644 index 00000000..abd2bad5 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsRequest.java @@ -0,0 +1,1099 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for ListCatalogItems method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest} + */ +public final class ListCatalogItemsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) + ListCatalogItemsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCatalogItemsRequest.newBuilder() to construct. + private ListCatalogItemsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCatalogItemsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCatalogItemsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCatalogItemsRequest( + 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(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. Maximum number of results to return per page. If zero, the
+   * service will choose a reasonable default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The previous ListCatalogItemsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The previous ListCatalogItemsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. A filter to apply on the list results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A filter to apply on the list results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.recommendationengine.v1beta1.ListCatalogItemsRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest other = + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest 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.recommendationengine.v1beta1.ListCatalogItemsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest 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.recommendationengine.v1beta1.ListCatalogItemsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest 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.recommendationengine.v1beta1.ListCatalogItemsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + 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.recommendationengine.v1beta1.ListCatalogItemsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest 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.recommendationengine.v1beta1.ListCatalogItemsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListCatalogItems method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest.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(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest build() { + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest result = + new com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.recommendationengine.v1beta1.ListCatalogItemsRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * "projects/*/locations/global/catalogs/default_catalog".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If zero, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If zero, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If zero, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The previous ListCatalogItemsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The previous ListCatalogItemsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The previous ListCatalogItemsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous ListCatalogItemsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous ListCatalogItemsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter to apply on the list results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A filter to apply on the list results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A filter to apply on the list results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter to apply on the list results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter to apply on the list results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = 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.recommendationengine.v1beta1.ListCatalogItemsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) + private static final com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCatalogItemsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCatalogItemsRequest(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.recommendationengine.v1beta1.ListCatalogItemsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsRequestOrBuilder.java new file mode 100644 index 00000000..c33eac5a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsRequestOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ListCatalogItemsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * "projects/*/locations/global/catalogs/default_catalog".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Maximum number of results to return per page. If zero, the
+   * service will choose a reasonable default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The previous ListCatalogItemsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The previous ListCatalogItemsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A filter to apply on the list results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter to apply on the list results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsResponse.java new file mode 100644 index 00000000..47001024 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsResponse.java @@ -0,0 +1,1183 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response message for ListCatalogItems method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse} + */ +public final class ListCatalogItemsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) + ListCatalogItemsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCatalogItemsResponse.newBuilder() to construct. + private ListCatalogItemsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCatalogItemsResponse() { + catalogItems_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCatalogItemsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCatalogItemsResponse( + 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)) { + catalogItems_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.CatalogItem>(); + mutable_bitField0_ |= 0x00000001; + } + catalogItems_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + catalogItems_ = java.util.Collections.unmodifiableList(catalogItems_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse.Builder.class); + } + + public static final int CATALOG_ITEMS_FIELD_NUMBER = 1; + private java.util.List catalogItems_; + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + public java.util.List + getCatalogItemsList() { + return catalogItems_; + } + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemsOrBuilderList() { + return catalogItems_; + } + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + public int getCatalogItemsCount() { + return catalogItems_.size(); + } + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItems(int index) { + return catalogItems_.get(index); + } + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemsOrBuilder(int index) { + return catalogItems_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListCatalogItemRequest.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListCatalogItemRequest.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 < catalogItems_.size(); i++) { + output.writeMessage(1, catalogItems_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < catalogItems_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, catalogItems_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.recommendationengine.v1beta1.ListCatalogItemsResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse other = + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) obj; + + if (!getCatalogItemsList().equals(other.getCatalogItemsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCatalogItemsCount() > 0) { + hash = (37 * hash) + CATALOG_ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getCatalogItemsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse 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.recommendationengine.v1beta1.ListCatalogItemsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse 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.recommendationengine.v1beta1.ListCatalogItemsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse 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.recommendationengine.v1beta1.ListCatalogItemsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + 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.recommendationengine.v1beta1.ListCatalogItemsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse 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.recommendationengine.v1beta1.ListCatalogItemsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListCatalogItems method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCatalogItemsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (catalogItemsBuilder_ == null) { + catalogItems_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + catalogItemsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListCatalogItemsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse build() { + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse result = + new com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse(this); + int from_bitField0_ = bitField0_; + if (catalogItemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + catalogItems_ = java.util.Collections.unmodifiableList(catalogItems_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.catalogItems_ = catalogItems_; + } else { + result.catalogItems_ = catalogItemsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.recommendationengine.v1beta1.ListCatalogItemsResponse) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + .getDefaultInstance()) return this; + if (catalogItemsBuilder_ == null) { + if (!other.catalogItems_.isEmpty()) { + if (catalogItems_.isEmpty()) { + catalogItems_ = other.catalogItems_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCatalogItemsIsMutable(); + catalogItems_.addAll(other.catalogItems_); + } + onChanged(); + } + } else { + if (!other.catalogItems_.isEmpty()) { + if (catalogItemsBuilder_.isEmpty()) { + catalogItemsBuilder_.dispose(); + catalogItemsBuilder_ = null; + catalogItems_ = other.catalogItems_; + bitField0_ = (bitField0_ & ~0x00000001); + catalogItemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCatalogItemsFieldBuilder() + : null; + } else { + catalogItemsBuilder_.addAllMessages(other.catalogItems_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + catalogItems_ = java.util.Collections.emptyList(); + + private void ensureCatalogItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + catalogItems_ = + new java.util.ArrayList( + catalogItems_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + catalogItemsBuilder_; + + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public java.util.List + getCatalogItemsList() { + if (catalogItemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(catalogItems_); + } else { + return catalogItemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public int getCatalogItemsCount() { + if (catalogItemsBuilder_ == null) { + return catalogItems_.size(); + } else { + return catalogItemsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItems(int index) { + if (catalogItemsBuilder_ == null) { + return catalogItems_.get(index); + } else { + return catalogItemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder setCatalogItems( + int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogItemsIsMutable(); + catalogItems_.set(index, value); + onChanged(); + } else { + catalogItemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder setCatalogItems( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.set(index, builderForValue.build()); + onChanged(); + } else { + catalogItemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder addCatalogItems( + com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogItemsIsMutable(); + catalogItems_.add(value); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder addCatalogItems( + int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogItemsIsMutable(); + catalogItems_.add(index, value); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder addCatalogItems( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.add(builderForValue.build()); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder addCatalogItems( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.add(index, builderForValue.build()); + onChanged(); + } else { + catalogItemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder addAllCatalogItems( + java.lang.Iterable + values) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, catalogItems_); + onChanged(); + } else { + catalogItemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder clearCatalogItems() { + if (catalogItemsBuilder_ == null) { + catalogItems_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + catalogItemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public Builder removeCatalogItems(int index) { + if (catalogItemsBuilder_ == null) { + ensureCatalogItemsIsMutable(); + catalogItems_.remove(index); + onChanged(); + } else { + catalogItemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder getCatalogItemsBuilder( + int index) { + return getCatalogItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemsOrBuilder(int index) { + if (catalogItemsBuilder_ == null) { + return catalogItems_.get(index); + } else { + return catalogItemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemsOrBuilderList() { + if (catalogItemsBuilder_ != null) { + return catalogItemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(catalogItems_); + } + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder + addCatalogItemsBuilder() { + return getCatalogItemsFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance()); + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder addCatalogItemsBuilder( + int index) { + return getCatalogItemsFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance()); + } + /** + * + * + *
+     * The catalog items.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * + */ + public java.util.List + getCatalogItemsBuilderList() { + return getCatalogItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemsFieldBuilder() { + if (catalogItemsBuilder_ == null) { + catalogItemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder>( + catalogItems_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + catalogItems_ = null; + } + return catalogItemsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListCatalogItemRequest.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListCatalogItemRequest.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListCatalogItemRequest.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListCatalogItemRequest.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListCatalogItemRequest.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.recommendationengine.v1beta1.ListCatalogItemsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) + private static final com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCatalogItemsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCatalogItemsResponse(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.recommendationengine.v1beta1.ListCatalogItemsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsResponseOrBuilder.java new file mode 100644 index 00000000..108dbed3 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListCatalogItemsResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ListCatalogItemsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + java.util.List getCatalogItemsList(); + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItems(int index); + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + int getCatalogItemsCount(); + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + java.util.List + getCatalogItemsOrBuilderList(); + /** + * + * + *
+   * The catalog items.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder getCatalogItemsOrBuilder( + int index); + + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListCatalogItemRequest.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListCatalogItemRequest.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsRequest.java new file mode 100644 index 00000000..0dce32bd --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsRequest.java @@ -0,0 +1,966 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for the `ListPredictionApiKeyRegistrations`.
+ * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest} + */ +public final class ListPredictionApiKeyRegistrationsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + ListPredictionApiKeyRegistrationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPredictionApiKeyRegistrationsRequest.newBuilder() to construct. + private ListPredictionApiKeyRegistrationsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPredictionApiKeyRegistrationsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPredictionApiKeyRegistrationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPredictionApiKeyRegistrationsRequest( + 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(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .class, + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent placement resource name such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent placement resource name such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. Maximum number of results to return per page. If unset, the
+   * service will choose a reasonable default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest other = + (com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListPredictionApiKeyRegistrations`.
+   * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .class, + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest.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(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + build() { + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + result = + new com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent placement resource name such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent placement resource name such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent placement resource name such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent placement resource name such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent placement resource name such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If unset, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If unset, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If unset, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + private static final com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPredictionApiKeyRegistrationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPredictionApiKeyRegistrationsRequest(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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsRequestOrBuilder.java new file mode 100644 index 00000000..c9b9f014 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ListPredictionApiKeyRegistrationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent placement resource name such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent placement resource name such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Maximum number of results to return per page. If unset, the
+   * service will choose a reasonable default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsResponse.java new file mode 100644 index 00000000..e0a90e67 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsResponse.java @@ -0,0 +1,1288 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response message for the `ListPredictionApiKeyRegistrations`.
+ * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse} + */ +public final class ListPredictionApiKeyRegistrationsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) + ListPredictionApiKeyRegistrationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPredictionApiKeyRegistrationsResponse.newBuilder() to construct. + private ListPredictionApiKeyRegistrationsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPredictionApiKeyRegistrationsResponse() { + predictionApiKeyRegistrations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPredictionApiKeyRegistrationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPredictionApiKeyRegistrationsResponse( + 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)) { + predictionApiKeyRegistrations_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1 + .PredictionApiKeyRegistration>(); + mutable_bitField0_ |= 0x00000001; + } + predictionApiKeyRegistrations_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + predictionApiKeyRegistrations_ = + java.util.Collections.unmodifiableList(predictionApiKeyRegistrations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + .class, + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + .Builder.class); + } + + public static final int PREDICTION_API_KEY_REGISTRATIONS_FIELD_NUMBER = 1; + private java.util.List + predictionApiKeyRegistrations_; + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public java.util.List + getPredictionApiKeyRegistrationsList() { + return predictionApiKeyRegistrations_; + } + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + getPredictionApiKeyRegistrationsOrBuilderList() { + return predictionApiKeyRegistrations_; + } + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public int getPredictionApiKeyRegistrationsCount() { + return predictionApiKeyRegistrations_.size(); + } + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getPredictionApiKeyRegistrations(int index) { + return predictionApiKeyRegistrations_.get(index); + } + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder + getPredictionApiKeyRegistrationsOrBuilder(int index) { + return predictionApiKeyRegistrations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If empty, the list is complete. If nonempty, pass the token to the next
+   * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If empty, the list is complete. If nonempty, pass the token to the next
+   * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 < predictionApiKeyRegistrations_.size(); i++) { + output.writeMessage(1, predictionApiKeyRegistrations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < predictionApiKeyRegistrations_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, predictionApiKeyRegistrations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse other = + (com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) + obj; + + if (!getPredictionApiKeyRegistrationsList() + .equals(other.getPredictionApiKeyRegistrationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPredictionApiKeyRegistrationsCount() > 0) { + hash = (37 * hash) + PREDICTION_API_KEY_REGISTRATIONS_FIELD_NUMBER; + hash = (53 * hash) + getPredictionApiKeyRegistrationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + 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.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListPredictionApiKeyRegistrations`.
+   * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse.class, + com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPredictionApiKeyRegistrationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (predictionApiKeyRegistrationsBuilder_ == null) { + predictionApiKeyRegistrations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + predictionApiKeyRegistrationsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + build() { + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + result = + new com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse(this); + int from_bitField0_ = bitField0_; + if (predictionApiKeyRegistrationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + predictionApiKeyRegistrations_ = + java.util.Collections.unmodifiableList(predictionApiKeyRegistrations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.predictionApiKeyRegistrations_ = predictionApiKeyRegistrations_; + } else { + result.predictionApiKeyRegistrations_ = predictionApiKeyRegistrationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + .getDefaultInstance()) return this; + if (predictionApiKeyRegistrationsBuilder_ == null) { + if (!other.predictionApiKeyRegistrations_.isEmpty()) { + if (predictionApiKeyRegistrations_.isEmpty()) { + predictionApiKeyRegistrations_ = other.predictionApiKeyRegistrations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.addAll(other.predictionApiKeyRegistrations_); + } + onChanged(); + } + } else { + if (!other.predictionApiKeyRegistrations_.isEmpty()) { + if (predictionApiKeyRegistrationsBuilder_.isEmpty()) { + predictionApiKeyRegistrationsBuilder_.dispose(); + predictionApiKeyRegistrationsBuilder_ = null; + predictionApiKeyRegistrations_ = other.predictionApiKeyRegistrations_; + bitField0_ = (bitField0_ & ~0x00000001); + predictionApiKeyRegistrationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPredictionApiKeyRegistrationsFieldBuilder() + : null; + } else { + predictionApiKeyRegistrationsBuilder_.addAllMessages( + other.predictionApiKeyRegistrations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + predictionApiKeyRegistrations_ = java.util.Collections.emptyList(); + + private void ensurePredictionApiKeyRegistrationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + predictionApiKeyRegistrations_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration>( + predictionApiKeyRegistrations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + predictionApiKeyRegistrationsBuilder_; + + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + getPredictionApiKeyRegistrationsList() { + if (predictionApiKeyRegistrationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(predictionApiKeyRegistrations_); + } else { + return predictionApiKeyRegistrationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public int getPredictionApiKeyRegistrationsCount() { + if (predictionApiKeyRegistrationsBuilder_ == null) { + return predictionApiKeyRegistrations_.size(); + } else { + return predictionApiKeyRegistrationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getPredictionApiKeyRegistrations(int index) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + return predictionApiKeyRegistrations_.get(index); + } else { + return predictionApiKeyRegistrationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder setPredictionApiKeyRegistrations( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration value) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.set(index, value); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder setPredictionApiKeyRegistrations( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + builderForValue) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.set(index, builderForValue.build()); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder addPredictionApiKeyRegistrations( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration value) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.add(value); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder addPredictionApiKeyRegistrations( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration value) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.add(index, value); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder addPredictionApiKeyRegistrations( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + builderForValue) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.add(builderForValue.build()); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder addPredictionApiKeyRegistrations( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + builderForValue) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.add(index, builderForValue.build()); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder addAllPredictionApiKeyRegistrations( + java.lang.Iterable< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration> + values) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + ensurePredictionApiKeyRegistrationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, predictionApiKeyRegistrations_); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder clearPredictionApiKeyRegistrations() { + if (predictionApiKeyRegistrationsBuilder_ == null) { + predictionApiKeyRegistrations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public Builder removePredictionApiKeyRegistrations(int index) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + ensurePredictionApiKeyRegistrationsIsMutable(); + predictionApiKeyRegistrations_.remove(index); + onChanged(); + } else { + predictionApiKeyRegistrationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + getPredictionApiKeyRegistrationsBuilder(int index) { + return getPredictionApiKeyRegistrationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder + getPredictionApiKeyRegistrationsOrBuilder(int index) { + if (predictionApiKeyRegistrationsBuilder_ == null) { + return predictionApiKeyRegistrations_.get(index); + } else { + return predictionApiKeyRegistrationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + getPredictionApiKeyRegistrationsOrBuilderList() { + if (predictionApiKeyRegistrationsBuilder_ != null) { + return predictionApiKeyRegistrationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(predictionApiKeyRegistrations_); + } + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + addPredictionApiKeyRegistrationsBuilder() { + return getPredictionApiKeyRegistrationsFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + addPredictionApiKeyRegistrationsBuilder(int index) { + return getPredictionApiKeyRegistrationsFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of registered API keys.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder> + getPredictionApiKeyRegistrationsBuilderList() { + return getPredictionApiKeyRegistrationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + getPredictionApiKeyRegistrationsFieldBuilder() { + if (predictionApiKeyRegistrationsBuilder_ == null) { + predictionApiKeyRegistrationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder, + com.google.cloud.recommendationengine.v1beta1 + .PredictionApiKeyRegistrationOrBuilder>( + predictionApiKeyRegistrations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + predictionApiKeyRegistrations_ = null; + } + return predictionApiKeyRegistrationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If empty, the list is complete. If nonempty, pass the token to the next
+     * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, pass the token to the next
+     * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, pass the token to the next
+     * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, pass the token to the next
+     * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, pass the token to the next
+     * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) + private static final com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1 + .ListPredictionApiKeyRegistrationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPredictionApiKeyRegistrationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPredictionApiKeyRegistrationsResponse(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.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsResponseOrBuilder.java new file mode 100644 index 00000000..b84893ce --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListPredictionApiKeyRegistrationsResponseOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ListPredictionApiKeyRegistrationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + java.util.List + getPredictionApiKeyRegistrationsList(); + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getPredictionApiKeyRegistrations(int index); + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + int getPredictionApiKeyRegistrationsCount(); + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder> + getPredictionApiKeyRegistrationsOrBuilderList(); + /** + * + * + *
+   * The list of registered API keys.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder + getPredictionApiKeyRegistrationsOrBuilder(int index); + + /** + * + * + *
+   * If empty, the list is complete. If nonempty, pass the token to the next
+   * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If empty, the list is complete. If nonempty, pass the token to the next
+   * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsRequest.java new file mode 100644 index 00000000..660dc1f6 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsRequest.java @@ -0,0 +1,1274 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for ListUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListUserEventsRequest} + */ +public final class ListUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) + ListUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUserEventsRequest.newBuilder() to construct. + private ListUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUserEventsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListUserEventsRequest( + 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(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. Maximum number of results to return per page. If zero, the
+   * service will choose a reasonable default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The previous ListUserEventsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The previous ListUserEventsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. Filtering expression to specify restrictions over
+   * returned events. This is a sequence of terms, where each term applies some
+   * kind of a restriction to the returned user events. Use this expression to
+   * restrict results to a specific time range, or filter events by eventType.
+   *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+   *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+   *   We expect only 3 types of fields:
+   *    * eventTime: this can be specified a maximum of 2 times, once with a
+   *      less than operator and once with a greater than operator. The
+   *      eventTime restrict should result in one contiguous valid eventTime
+   *      range.
+   *    * eventType: only 1 eventType restriction can be specified.
+   *    * eventsMissingCatalogItems: specififying this will restrict results
+   *      to events for which catalog items were not found in the catalog. The
+   *      default behavior is to return only those events for which catalog
+   *      items were found.
+   *   Some examples of valid filters expressions:
+   *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventTime < "2012-04-23T18:30:43.511Z"
+   *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventType = detail-page-view
+   *   * Example 3: eventsMissingCatalogItems
+   *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+   *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+   *   * Example 5: eventType = search
+   *   * Example 6: eventsMissingCatalogItems
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering expression to specify restrictions over
+   * returned events. This is a sequence of terms, where each term applies some
+   * kind of a restriction to the returned user events. Use this expression to
+   * restrict results to a specific time range, or filter events by eventType.
+   *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+   *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+   *   We expect only 3 types of fields:
+   *    * eventTime: this can be specified a maximum of 2 times, once with a
+   *      less than operator and once with a greater than operator. The
+   *      eventTime restrict should result in one contiguous valid eventTime
+   *      range.
+   *    * eventType: only 1 eventType restriction can be specified.
+   *    * eventsMissingCatalogItems: specififying this will restrict results
+   *      to events for which catalog items were not found in the catalog. The
+   *      default behavior is to return only those events for which catalog
+   *      items were found.
+   *   Some examples of valid filters expressions:
+   *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventTime < "2012-04-23T18:30:43.511Z"
+   *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventType = detail-page-view
+   *   * Example 3: eventsMissingCatalogItems
+   *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+   *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+   *   * Example 5: eventType = search
+   *   * Example 6: eventsMissingCatalogItems
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.recommendationengine.v1beta1.ListUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest other = + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest 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.recommendationengine.v1beta1.ListUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest 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.recommendationengine.v1beta1.ListUserEventsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest 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.recommendationengine.v1beta1.ListUserEventsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + 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.recommendationengine.v1beta1.ListUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest 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.recommendationengine.v1beta1.ListUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest.class, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest.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(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest build() { + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest result = + new com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.recommendationengine.v1beta1.ListUserEventsRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If zero, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If zero, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. If zero, the
+     * service will choose a reasonable default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The previous ListUserEventsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The previous ListUserEventsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The previous ListUserEventsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous ListUserEventsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous ListUserEventsResponse.next_page_token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering expression to specify restrictions over
+     * returned events. This is a sequence of terms, where each term applies some
+     * kind of a restriction to the returned user events. Use this expression to
+     * restrict results to a specific time range, or filter events by eventType.
+     *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+     *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+     *   We expect only 3 types of fields:
+     *    * eventTime: this can be specified a maximum of 2 times, once with a
+     *      less than operator and once with a greater than operator. The
+     *      eventTime restrict should result in one contiguous valid eventTime
+     *      range.
+     *    * eventType: only 1 eventType restriction can be specified.
+     *    * eventsMissingCatalogItems: specififying this will restrict results
+     *      to events for which catalog items were not found in the catalog. The
+     *      default behavior is to return only those events for which catalog
+     *      items were found.
+     *   Some examples of valid filters expressions:
+     *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventTime < "2012-04-23T18:30:43.511Z"
+     *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventType = detail-page-view
+     *   * Example 3: eventsMissingCatalogItems
+     *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+     *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+     *   * Example 5: eventType = search
+     *   * Example 6: eventsMissingCatalogItems
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering expression to specify restrictions over
+     * returned events. This is a sequence of terms, where each term applies some
+     * kind of a restriction to the returned user events. Use this expression to
+     * restrict results to a specific time range, or filter events by eventType.
+     *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+     *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+     *   We expect only 3 types of fields:
+     *    * eventTime: this can be specified a maximum of 2 times, once with a
+     *      less than operator and once with a greater than operator. The
+     *      eventTime restrict should result in one contiguous valid eventTime
+     *      range.
+     *    * eventType: only 1 eventType restriction can be specified.
+     *    * eventsMissingCatalogItems: specififying this will restrict results
+     *      to events for which catalog items were not found in the catalog. The
+     *      default behavior is to return only those events for which catalog
+     *      items were found.
+     *   Some examples of valid filters expressions:
+     *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventTime < "2012-04-23T18:30:43.511Z"
+     *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventType = detail-page-view
+     *   * Example 3: eventsMissingCatalogItems
+     *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+     *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+     *   * Example 5: eventType = search
+     *   * Example 6: eventsMissingCatalogItems
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering expression to specify restrictions over
+     * returned events. This is a sequence of terms, where each term applies some
+     * kind of a restriction to the returned user events. Use this expression to
+     * restrict results to a specific time range, or filter events by eventType.
+     *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+     *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+     *   We expect only 3 types of fields:
+     *    * eventTime: this can be specified a maximum of 2 times, once with a
+     *      less than operator and once with a greater than operator. The
+     *      eventTime restrict should result in one contiguous valid eventTime
+     *      range.
+     *    * eventType: only 1 eventType restriction can be specified.
+     *    * eventsMissingCatalogItems: specififying this will restrict results
+     *      to events for which catalog items were not found in the catalog. The
+     *      default behavior is to return only those events for which catalog
+     *      items were found.
+     *   Some examples of valid filters expressions:
+     *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventTime < "2012-04-23T18:30:43.511Z"
+     *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventType = detail-page-view
+     *   * Example 3: eventsMissingCatalogItems
+     *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+     *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+     *   * Example 5: eventType = search
+     *   * Example 6: eventsMissingCatalogItems
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering expression to specify restrictions over
+     * returned events. This is a sequence of terms, where each term applies some
+     * kind of a restriction to the returned user events. Use this expression to
+     * restrict results to a specific time range, or filter events by eventType.
+     *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+     *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+     *   We expect only 3 types of fields:
+     *    * eventTime: this can be specified a maximum of 2 times, once with a
+     *      less than operator and once with a greater than operator. The
+     *      eventTime restrict should result in one contiguous valid eventTime
+     *      range.
+     *    * eventType: only 1 eventType restriction can be specified.
+     *    * eventsMissingCatalogItems: specififying this will restrict results
+     *      to events for which catalog items were not found in the catalog. The
+     *      default behavior is to return only those events for which catalog
+     *      items were found.
+     *   Some examples of valid filters expressions:
+     *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventTime < "2012-04-23T18:30:43.511Z"
+     *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventType = detail-page-view
+     *   * Example 3: eventsMissingCatalogItems
+     *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+     *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+     *   * Example 5: eventType = search
+     *   * Example 6: eventsMissingCatalogItems
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering expression to specify restrictions over
+     * returned events. This is a sequence of terms, where each term applies some
+     * kind of a restriction to the returned user events. Use this expression to
+     * restrict results to a specific time range, or filter events by eventType.
+     *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+     *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+     *   We expect only 3 types of fields:
+     *    * eventTime: this can be specified a maximum of 2 times, once with a
+     *      less than operator and once with a greater than operator. The
+     *      eventTime restrict should result in one contiguous valid eventTime
+     *      range.
+     *    * eventType: only 1 eventType restriction can be specified.
+     *    * eventsMissingCatalogItems: specififying this will restrict results
+     *      to events for which catalog items were not found in the catalog. The
+     *      default behavior is to return only those events for which catalog
+     *      items were found.
+     *   Some examples of valid filters expressions:
+     *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventTime < "2012-04-23T18:30:43.511Z"
+     *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+     *             eventType = detail-page-view
+     *   * Example 3: eventsMissingCatalogItems
+     *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+     *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+     *   * Example 5: eventType = search
+     *   * Example 6: eventsMissingCatalogItems
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = 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.recommendationengine.v1beta1.ListUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) + private static final com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListUserEventsRequest(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.recommendationengine.v1beta1.ListUserEventsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..8e87bd4e --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsRequestOrBuilder.java @@ -0,0 +1,166 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ListUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ListUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Maximum number of results to return per page. If zero, the
+   * service will choose a reasonable default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The previous ListUserEventsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The previous ListUserEventsResponse.next_page_token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering expression to specify restrictions over
+   * returned events. This is a sequence of terms, where each term applies some
+   * kind of a restriction to the returned user events. Use this expression to
+   * restrict results to a specific time range, or filter events by eventType.
+   *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+   *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+   *   We expect only 3 types of fields:
+   *    * eventTime: this can be specified a maximum of 2 times, once with a
+   *      less than operator and once with a greater than operator. The
+   *      eventTime restrict should result in one contiguous valid eventTime
+   *      range.
+   *    * eventType: only 1 eventType restriction can be specified.
+   *    * eventsMissingCatalogItems: specififying this will restrict results
+   *      to events for which catalog items were not found in the catalog. The
+   *      default behavior is to return only those events for which catalog
+   *      items were found.
+   *   Some examples of valid filters expressions:
+   *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventTime < "2012-04-23T18:30:43.511Z"
+   *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventType = detail-page-view
+   *   * Example 3: eventsMissingCatalogItems
+   *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+   *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+   *   * Example 5: eventType = search
+   *   * Example 6: eventsMissingCatalogItems
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering expression to specify restrictions over
+   * returned events. This is a sequence of terms, where each term applies some
+   * kind of a restriction to the returned user events. Use this expression to
+   * restrict results to a specific time range, or filter events by eventType.
+   *    eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems
+   *    eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+   *   We expect only 3 types of fields:
+   *    * eventTime: this can be specified a maximum of 2 times, once with a
+   *      less than operator and once with a greater than operator. The
+   *      eventTime restrict should result in one contiguous valid eventTime
+   *      range.
+   *    * eventType: only 1 eventType restriction can be specified.
+   *    * eventsMissingCatalogItems: specififying this will restrict results
+   *      to events for which catalog items were not found in the catalog. The
+   *      default behavior is to return only those events for which catalog
+   *      items were found.
+   *   Some examples of valid filters expressions:
+   *   * Example 1: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventTime < "2012-04-23T18:30:43.511Z"
+   *   * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+   *             eventType = detail-page-view
+   *   * Example 3: eventsMissingCatalogItems
+   *             eventType = search eventTime < "2018-04-23T18:30:43.511Z"
+   *   * Example 4: eventTime > "2012-04-23T18:25:43.511Z"
+   *   * Example 5: eventType = search
+   *   * Example 6: eventsMissingCatalogItems
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsResponse.java new file mode 100644 index 00000000..67f8df23 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsResponse.java @@ -0,0 +1,1159 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response message for ListUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListUserEventsResponse} + */ +public final class ListUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) + ListUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUserEventsResponse.newBuilder() to construct. + private ListUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUserEventsResponse() { + userEvents_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListUserEventsResponse( + 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)) { + userEvents_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.UserEvent>(); + mutable_bitField0_ |= 0x00000001; + } + userEvents_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEvent.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse.Builder.class); + } + + public static final int USER_EVENTS_FIELD_NUMBER = 1; + private java.util.List userEvents_; + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public java.util.List + getUserEventsList() { + return userEvents_; + } + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public java.util.List + getUserEventsOrBuilderList() { + return userEvents_; + } + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public int getUserEventsCount() { + return userEvents_.size(); + } + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvents(int index) { + return userEvents_.get(index); + } + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsOrBuilder( + int index) { + return userEvents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListUserEvents.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListUserEvents.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 < userEvents_.size(); i++) { + output.writeMessage(1, userEvents_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < userEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, userEvents_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.recommendationengine.v1beta1.ListUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse other = + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) obj; + + if (!getUserEventsList().equals(other.getUserEventsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUserEventsCount() > 0) { + hash = (37 * hash) + USER_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getUserEventsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse 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.recommendationengine.v1beta1.ListUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse 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.recommendationengine.v1beta1.ListUserEventsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse 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.recommendationengine.v1beta1.ListUserEventsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + 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.recommendationengine.v1beta1.ListUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse 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.recommendationengine.v1beta1.ListUserEventsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ListUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse.class, + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserEventsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + userEventsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse build() { + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse result = + new com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse(this); + int from_bitField0_ = bitField0_; + if (userEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.userEvents_ = userEvents_; + } else { + result.userEvents_ = userEventsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.recommendationengine.v1beta1.ListUserEventsResponse) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + .getDefaultInstance()) return this; + if (userEventsBuilder_ == null) { + if (!other.userEvents_.isEmpty()) { + if (userEvents_.isEmpty()) { + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUserEventsIsMutable(); + userEvents_.addAll(other.userEvents_); + } + onChanged(); + } + } else { + if (!other.userEvents_.isEmpty()) { + if (userEventsBuilder_.isEmpty()) { + userEventsBuilder_.dispose(); + userEventsBuilder_ = null; + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + userEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUserEventsFieldBuilder() + : null; + } else { + userEventsBuilder_.addAllMessages(other.userEvents_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List userEvents_ = + java.util.Collections.emptyList(); + + private void ensureUserEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + userEvents_ = + new java.util.ArrayList( + userEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + userEventsBuilder_; + + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public java.util.List + getUserEventsList() { + if (userEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(userEvents_); + } else { + return userEventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public int getUserEventsCount() { + if (userEventsBuilder_ == null) { + return userEvents_.size(); + } else { + return userEventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvents(int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder setUserEvents( + int index, com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.set(index, value); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder setUserEvents( + int index, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder addUserEvents(com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(value); + onChanged(); + } else { + userEventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder addUserEvents( + int index, com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(index, value); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder addUserEvents( + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder addUserEvents( + int index, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder addAllUserEvents( + java.lang.Iterable + values) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, userEvents_); + onChanged(); + } else { + userEventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder clearUserEvents() { + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + userEventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public Builder removeUserEvents(int index) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.remove(index); + onChanged(); + } else { + userEventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder getUserEventsBuilder( + int index) { + return getUserEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsOrBuilder( + int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventsOrBuilderList() { + if (userEventsBuilder_ != null) { + return userEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(userEvents_); + } + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder addUserEventsBuilder() { + return getUserEventsFieldBuilder() + .addBuilder(com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder addUserEventsBuilder( + int index) { + return getUserEventsFieldBuilder() + .addBuilder( + index, com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * The user events.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + public java.util.List + getUserEventsBuilderList() { + return getUserEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventsFieldBuilder() { + if (userEventsBuilder_ == null) { + userEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder>( + userEvents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + userEvents_ = null; + } + return userEventsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListUserEvents.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListUserEvents.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListUserEvents.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListUserEvents.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's ListUserEvents.page_token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.recommendationengine.v1beta1.ListUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) + private static final com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListUserEventsResponse(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.recommendationengine.v1beta1.ListUserEventsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..2b2cd934 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ListUserEventsResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ListUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ListUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + java.util.List getUserEventsList(); + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvents(int index); + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + int getUserEventsCount(); + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + java.util.List + getUserEventsOrBuilderList(); + /** + * + * + *
+   * The user events.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsOrBuilder( + int index); + + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListUserEvents.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's ListUserEvents.page_token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PlacementName.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PlacementName.java new file mode 100644 index 00000000..53fcfa5b --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PlacementName.java @@ -0,0 +1,277 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class PlacementName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String catalog; + private final String eventStore; + private final String placement; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getEventStore() { + return eventStore; + } + + public String getPlacement() { + return placement; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private PlacementName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + eventStore = Preconditions.checkNotNull(builder.getEventStore()); + placement = Preconditions.checkNotNull(builder.getPlacement()); + } + + public static PlacementName of( + String project, String location, String catalog, String eventStore, String placement) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setEventStore(eventStore) + .setPlacement(placement) + .build(); + } + + public static String format( + String project, String location, String catalog, String eventStore, String placement) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setEventStore(eventStore) + .setPlacement(placement) + .build() + .toString(); + } + + public static PlacementName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "PlacementName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("event_store"), + matchMap.get("placement")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (PlacementName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("catalog", catalog); + fieldMapBuilder.put("eventStore", eventStore); + fieldMapBuilder.put("placement", placement); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "event_store", + eventStore, + "placement", + placement); + } + + /** Builder for PlacementName. */ + public static class Builder { + + private String project; + private String location; + private String catalog; + private String eventStore; + private String placement; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getEventStore() { + return eventStore; + } + + public String getPlacement() { + return placement; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public Builder setEventStore(String eventStore) { + this.eventStore = eventStore; + return this; + } + + public Builder setPlacement(String placement) { + this.placement = placement; + return this; + } + + private Builder() {} + + private Builder(PlacementName placementName) { + project = placementName.project; + location = placementName.location; + catalog = placementName.catalog; + eventStore = placementName.eventStore; + placement = placementName.placement; + } + + public PlacementName build() { + return new PlacementName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PlacementName) { + PlacementName that = (PlacementName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.catalog.equals(that.catalog)) + && (this.eventStore.equals(that.eventStore)) + && (this.placement.equals(that.placement)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= catalog.hashCode(); + h *= 1000003; + h ^= eventStore.hashCode(); + h *= 1000003; + h ^= placement.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictRequest.java new file mode 100644 index 00000000..5ce7911d --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictRequest.java @@ -0,0 +1,2572 @@ +/* + * 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/recommendationengine/v1beta1/prediction_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for Predict method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PredictRequest} + */ +public final class PredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PredictRequest) + PredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictRequest.newBuilder() to construct. + private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictRequest() { + name_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder subBuilder = null; + if (userEvent_ != null) { + subBuilder = userEvent_.toBuilder(); + } + userEvent_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEvent.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userEvent_); + userEvent_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: + { + dryRun_ = input.readBool(); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + params_ = + com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + params_.getMutableMap().put(params__.getKey(), params__.getValue()); + break; + } + case 56: + { + pageSize_ = input.readInt32(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetParams(); + case 9: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictRequest.class, + com.google.cloud.recommendationengine.v1beta1.PredictRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+   * The id of the recommendation engine placement. This id is used to identify
+   * the set of models that will be used to make the prediction.
+   * We currently support three placements with the following IDs by default:
+   * * `shopping_cart`: Predicts items frequently bought together with one or
+   *   more catalog items in the same shopping session. Commonly displayed after
+   *   `add-to-cart` events, on product detail pages, or on the shopping cart
+   *   page.
+   * * `home_page`: Predicts the next product that a user will most likely
+   *   engage with or purchase based on the shopping or viewing history of the
+   *   specified `userId` or `visitorId`. For example - Recommendations for you.
+   * * `product_detail`: Predicts the next product that a user will most likely
+   *   engage with or purchase. The prediction is based on the shopping or
+   *   viewing history of the specified `userId` or `visitorId` and its
+   *   relevance to a specified `CatalogItem`. Typically used on product detail
+   *   pages. For example - More items like this.
+   * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+   *   specified `userId` or `visitorId`, most recent ones first. Returns
+   *   nothing if neither of them has viewed any items yet. For example -
+   *   Recently viewed.
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+   * The id of the recommendation engine placement. This id is used to identify
+   * the set of models that will be used to make the prediction.
+   * We currently support three placements with the following IDs by default:
+   * * `shopping_cart`: Predicts items frequently bought together with one or
+   *   more catalog items in the same shopping session. Commonly displayed after
+   *   `add-to-cart` events, on product detail pages, or on the shopping cart
+   *   page.
+   * * `home_page`: Predicts the next product that a user will most likely
+   *   engage with or purchase based on the shopping or viewing history of the
+   *   specified `userId` or `visitorId`. For example - Recommendations for you.
+   * * `product_detail`: Predicts the next product that a user will most likely
+   *   engage with or purchase. The prediction is based on the shopping or
+   *   viewing history of the specified `userId` or `visitorId` and its
+   *   relevance to a specified `CatalogItem`. Typically used on product detail
+   *   pages. For example - More items like this.
+   * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+   *   specified `userId` or `visitorId`, most recent ones first. Returns
+   *   nothing if neither of them has viewed any items yet. For example -
+   *   Recently viewed.
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.UserEvent userEvent_; + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEvent_ != null; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventOrBuilder() { + return getUserEvent(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 7; + private int pageSize_; + /** + * + * + *
+   * Optional. Maximum number of results to return per page. Set this property
+   * to the number of prediction results required. If zero, the service will
+   * choose a reasonable default.
+   * 
+ * + * int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. Filter for restricting prediction results. Accepts values for
+   * tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to items that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1 KiB.
+   *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter for restricting prediction results. Accepts values for
+   * tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to items that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1 KiB.
+   *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DRY_RUN_FIELD_NUMBER = 4; + private boolean dryRun_; + /** + * + * + *
+   * Optional. Use dryRun mode for this prediction query. If set to true, a
+   * dummy model will be used that returns arbitrary catalog items.
+   * Note that the dryRun mode should only be used for testing the API, or if
+   * the model is not ready.
+   * 
+ * + * bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + public boolean getDryRun() { + return dryRun_; + } + + public static final int PARAMS_FIELD_NUMBER = 6; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LABELS_FIELD_NUMBER = 9; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (dryRun_ != false) { + output.writeBool(4, dryRun_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 6); + if (pageSize_ != 0) { + output.writeInt32(7, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 9); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (userEvent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (dryRun_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, dryRun_); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, params__); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, labels__); + } + 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.recommendationengine.v1beta1.PredictRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PredictRequest other = + (com.google.cloud.recommendationengine.v1beta1.PredictRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getDryRun() != other.getDryRun()) return false; + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasUserEvent()) { + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + DRY_RUN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDryRun()); + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest 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.recommendationengine.v1beta1.PredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest 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.recommendationengine.v1beta1.PredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest 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.recommendationengine.v1beta1.PredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest 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.recommendationengine.v1beta1.PredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest 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.recommendationengine.v1beta1.PredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for Predict method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PredictRequest) + com.google.cloud.recommendationengine.v1beta1.PredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetParams(); + case 9: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableParams(); + case 9: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictRequest.class, + com.google.cloud.recommendationengine.v1beta1.PredictRequest.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.PredictRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (userEventBuilder_ == null) { + userEvent_ = null; + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + dryRun_ = false; + + internalGetMutableParams().clear(); + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictRequest build() { + com.google.cloud.recommendationengine.v1beta1.PredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PredictRequest result = + new com.google.cloud.recommendationengine.v1beta1.PredictRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (userEventBuilder_ == null) { + result.userEvent_ = userEvent_; + } else { + result.userEvent_ = userEventBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.dryRun_ = dryRun_; + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + 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.recommendationengine.v1beta1.PredictRequest) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.PredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.PredictRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PredictRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getDryRun() != false) { + setDryRun(other.getDryRun()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + 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.recommendationengine.v1beta1.PredictRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PredictRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+     * The id of the recommendation engine placement. This id is used to identify
+     * the set of models that will be used to make the prediction.
+     * We currently support three placements with the following IDs by default:
+     * * `shopping_cart`: Predicts items frequently bought together with one or
+     *   more catalog items in the same shopping session. Commonly displayed after
+     *   `add-to-cart` events, on product detail pages, or on the shopping cart
+     *   page.
+     * * `home_page`: Predicts the next product that a user will most likely
+     *   engage with or purchase based on the shopping or viewing history of the
+     *   specified `userId` or `visitorId`. For example - Recommendations for you.
+     * * `product_detail`: Predicts the next product that a user will most likely
+     *   engage with or purchase. The prediction is based on the shopping or
+     *   viewing history of the specified `userId` or `visitorId` and its
+     *   relevance to a specified `CatalogItem`. Typically used on product detail
+     *   pages. For example - More items like this.
+     * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+     *   specified `userId` or `visitorId`, most recent ones first. Returns
+     *   nothing if neither of them has viewed any items yet. For example -
+     *   Recently viewed.
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+     * The id of the recommendation engine placement. This id is used to identify
+     * the set of models that will be used to make the prediction.
+     * We currently support three placements with the following IDs by default:
+     * * `shopping_cart`: Predicts items frequently bought together with one or
+     *   more catalog items in the same shopping session. Commonly displayed after
+     *   `add-to-cart` events, on product detail pages, or on the shopping cart
+     *   page.
+     * * `home_page`: Predicts the next product that a user will most likely
+     *   engage with or purchase based on the shopping or viewing history of the
+     *   specified `userId` or `visitorId`. For example - Recommendations for you.
+     * * `product_detail`: Predicts the next product that a user will most likely
+     *   engage with or purchase. The prediction is based on the shopping or
+     *   viewing history of the specified `userId` or `visitorId` and its
+     *   relevance to a specified `CatalogItem`. Typically used on product detail
+     *   pages. For example - More items like this.
+     * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+     *   specified `userId` or `visitorId`, most recent ones first. Returns
+     *   nothing if neither of them has viewed any items yet. For example -
+     *   Recently viewed.
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+     * The id of the recommendation engine placement. This id is used to identify
+     * the set of models that will be used to make the prediction.
+     * We currently support three placements with the following IDs by default:
+     * * `shopping_cart`: Predicts items frequently bought together with one or
+     *   more catalog items in the same shopping session. Commonly displayed after
+     *   `add-to-cart` events, on product detail pages, or on the shopping cart
+     *   page.
+     * * `home_page`: Predicts the next product that a user will most likely
+     *   engage with or purchase based on the shopping or viewing history of the
+     *   specified `userId` or `visitorId`. For example - Recommendations for you.
+     * * `product_detail`: Predicts the next product that a user will most likely
+     *   engage with or purchase. The prediction is based on the shopping or
+     *   viewing history of the specified `userId` or `visitorId` and its
+     *   relevance to a specified `CatalogItem`. Typically used on product detail
+     *   pages. For example - More items like this.
+     * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+     *   specified `userId` or `visitorId`, most recent ones first. Returns
+     *   nothing if neither of them has viewed any items yet. For example -
+     *   Recently viewed.
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+     * The id of the recommendation engine placement. This id is used to identify
+     * the set of models that will be used to make the prediction.
+     * We currently support three placements with the following IDs by default:
+     * * `shopping_cart`: Predicts items frequently bought together with one or
+     *   more catalog items in the same shopping session. Commonly displayed after
+     *   `add-to-cart` events, on product detail pages, or on the shopping cart
+     *   page.
+     * * `home_page`: Predicts the next product that a user will most likely
+     *   engage with or purchase based on the shopping or viewing history of the
+     *   specified `userId` or `visitorId`. For example - Recommendations for you.
+     * * `product_detail`: Predicts the next product that a user will most likely
+     *   engage with or purchase. The prediction is based on the shopping or
+     *   viewing history of the specified `userId` or `visitorId` and its
+     *   relevance to a specified `CatalogItem`. Typically used on product detail
+     *   pages. For example - More items like this.
+     * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+     *   specified `userId` or `visitorId`, most recent ones first. Returns
+     *   nothing if neither of them has viewed any items yet. For example -
+     *   Recently viewed.
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+     * The id of the recommendation engine placement. This id is used to identify
+     * the set of models that will be used to make the prediction.
+     * We currently support three placements with the following IDs by default:
+     * * `shopping_cart`: Predicts items frequently bought together with one or
+     *   more catalog items in the same shopping session. Commonly displayed after
+     *   `add-to-cart` events, on product detail pages, or on the shopping cart
+     *   page.
+     * * `home_page`: Predicts the next product that a user will most likely
+     *   engage with or purchase based on the shopping or viewing history of the
+     *   specified `userId` or `visitorId`. For example - Recommendations for you.
+     * * `product_detail`: Predicts the next product that a user will most likely
+     *   engage with or purchase. The prediction is based on the shopping or
+     *   viewing history of the specified `userId` or `visitorId` and its
+     *   relevance to a specified `CatalogItem`. Typically used on product detail
+     *   pages. For example - More items like this.
+     * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+     *   specified `userId` or `visitorId`, most recent ones first. Returns
+     *   nothing if neither of them has viewed any items yet. For example -
+     *   Recently viewed.
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 com.google.cloud.recommendationengine.v1beta1.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEventBuilder_ != null || userEvent_ != null; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + onChanged(); + } else { + userEventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent( + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + onChanged(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventBuilder_ == null) { + if (userEvent_ != null) { + userEvent_ = + com.google.cloud.recommendationengine.v1beta1.UserEvent.newBuilder(userEvent_) + .mergeFrom(value) + .buildPartial(); + } else { + userEvent_ = value; + } + onChanged(); + } else { + userEventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + if (userEventBuilder_ == null) { + userEvent_ = null; + onChanged(); + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder getUserEventBuilder() { + + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder + getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Maximum number of results to return per page. Set this property
+     * to the number of prediction results required. If zero, the service will
+     * choose a reasonable default.
+     * 
+ * + * int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. Set this property
+     * to the number of prediction results required. If zero, the service will
+     * choose a reasonable default.
+     * 
+ * + * int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Maximum number of results to return per page. Set this property
+     * to the number of prediction results required. If zero, the service will
+     * choose a reasonable default.
+     * 
+ * + * int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filter for restricting prediction results. Accepts values for
+     * tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to items that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1 KiB.
+     *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter for restricting prediction results. Accepts values for
+     * tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to items that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1 KiB.
+     *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter for restricting prediction results. Accepts values for
+     * tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to items that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1 KiB.
+     *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter for restricting prediction results. Accepts values for
+     * tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to items that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1 KiB.
+     *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter for restricting prediction results. Accepts values for
+     * tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to items that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1 KiB.
+     *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean dryRun_; + /** + * + * + *
+     * Optional. Use dryRun mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary catalog items.
+     * Note that the dryRun mode should only be used for testing the API, or if
+     * the model is not ready.
+     * 
+ * + * bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + public boolean getDryRun() { + return dryRun_; + } + /** + * + * + *
+     * Optional. Use dryRun mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary catalog items.
+     * Note that the dryRun mode should only be used for testing the API, or if
+     * the model is not ready.
+     * 
+ * + * bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The dryRun to set. + * @return This builder for chaining. + */ + public Builder setDryRun(boolean value) { + + dryRun_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Use dryRun mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary catalog items.
+     * Note that the dryRun mode should only be used for testing the API, or if
+     * the model is not ready.
+     * 
+ * + * bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDryRun() { + + dryRun_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + private com.google.protobuf.MapField + internalGetMutableParams() { + onChanged(); + ; + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParams() { + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeParams(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParams().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParams() { + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putParams(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParams().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+     *    object will be returned in the
+     *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+     *    response.
+     * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned item will be set in the `metadata`
+     *    field in the prediction response. The given 'score' indicates the
+     *    probability of an item being clicked/purchased given the user's context
+     *    and history.
+     * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. The labels for the predict request.
+     *  * Label keys can contain lowercase letters, digits and hyphens, must start
+     *    with a letter, and must end with a letter or digit.
+     *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+     *    must start with a letter, and must end with a letter or digit.
+     *  * No more than 64 labels can be associated with a given request.
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + 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.recommendationengine.v1beta1.PredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PredictRequest) + private static final com.google.cloud.recommendationengine.v1beta1.PredictRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.PredictRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictRequest(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.recommendationengine.v1beta1.PredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictRequestOrBuilder.java new file mode 100644 index 00000000..9312c6f3 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictRequestOrBuilder.java @@ -0,0 +1,450 @@ +/* + * 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/recommendationengine/v1beta1/prediction_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+   * The id of the recommendation engine placement. This id is used to identify
+   * the set of models that will be used to make the prediction.
+   * We currently support three placements with the following IDs by default:
+   * * `shopping_cart`: Predicts items frequently bought together with one or
+   *   more catalog items in the same shopping session. Commonly displayed after
+   *   `add-to-cart` events, on product detail pages, or on the shopping cart
+   *   page.
+   * * `home_page`: Predicts the next product that a user will most likely
+   *   engage with or purchase based on the shopping or viewing history of the
+   *   specified `userId` or `visitorId`. For example - Recommendations for you.
+   * * `product_detail`: Predicts the next product that a user will most likely
+   *   engage with or purchase. The prediction is based on the shopping or
+   *   viewing history of the specified `userId` or `visitorId` and its
+   *   relevance to a specified `CatalogItem`. Typically used on product detail
+   *   pages. For example - More items like this.
+   * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+   *   specified `userId` or `visitorId`, most recent ones first. Returns
+   *   nothing if neither of them has viewed any items yet. For example -
+   *   Recently viewed.
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+   * The id of the recommendation engine placement. This id is used to identify
+   * the set of models that will be used to make the prediction.
+   * We currently support three placements with the following IDs by default:
+   * * `shopping_cart`: Predicts items frequently bought together with one or
+   *   more catalog items in the same shopping session. Commonly displayed after
+   *   `add-to-cart` events, on product detail pages, or on the shopping cart
+   *   page.
+   * * `home_page`: Predicts the next product that a user will most likely
+   *   engage with or purchase based on the shopping or viewing history of the
+   *   specified `userId` or `visitorId`. For example - Recommendations for you.
+   * * `product_detail`: Predicts the next product that a user will most likely
+   *   engage with or purchase. The prediction is based on the shopping or
+   *   viewing history of the specified `userId` or `visitorId` and its
+   *   relevance to a specified `CatalogItem`. Typically used on product detail
+   *   pages. For example - More items like this.
+   * * `recently_viewed_default`: Returns up to 75 items recently viewed by the
+   *   specified `userId` or `visitorId`, most recent ones first. Returns
+   *   nothing if neither of them has viewed any items yet. For example -
+   *   Recently viewed.
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventOrBuilder(); + + /** + * + * + *
+   * Optional. Maximum number of results to return per page. Set this property
+   * to the number of prediction results required. If zero, the service will
+   * choose a reasonable default.
+   * 
+ * + * int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filter for restricting prediction results. Accepts values for
+   * tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to items that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1 KiB.
+   *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filter for restricting prediction results. Accepts values for
+   * tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to items that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1 KiB.
+   *  * filterOutOfStockItems. Restricts predictions to items that do not have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Use dryRun mode for this prediction query. If set to true, a
+   * dummy model will be used that returns arbitrary catalog items.
+   * Note that the dryRun mode should only be used for testing the API, or if
+   * the model is not ready.
+   * 
+ * + * bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + boolean getDryRun(); + + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getParamsCount(); + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Optional. Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
+   *    object will be returned in the
+   *   `PredictResponse.PredictionResult.itemMetadata` object in the method
+   *    response.
+   * * `returnItemScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned item will be set in the `metadata`
+   *    field in the prediction response. The given 'score' indicates the
+   *    probability of an item being clicked/purchased given the user's context
+   *    and history.
+   * 
+ * + * + * map<string, .google.protobuf.Value> params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.Value getParamsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. The labels for the predict request.
+   *  * Label keys can contain lowercase letters, digits and hyphens, must start
+   *    with a letter, and must end with a letter or digit.
+   *  * Non-zero label values can contain lowercase letters, digits and hyphens,
+   *    must start with a letter, and must end with a letter or digit.
+   *  * No more than 64 labels can be associated with a given request.
+   * See https://goo.gl/xmQnxf for more information on and examples of labels.
+   * 
+ * + * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictResponse.java new file mode 100644 index 00000000..ef0e73b1 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictResponse.java @@ -0,0 +1,3282 @@ +/* + * 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/recommendationengine/v1beta1/prediction_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response message for predict method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PredictResponse} + */ +public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PredictResponse) + PredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictResponse.newBuilder() to construct. + private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictResponse() { + results_ = java.util.Collections.emptyList(); + recommendationToken_ = ""; + itemsMissingInCatalog_ = com.google.protobuf.LazyStringArrayList.EMPTY; + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictResponse( + 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)) { + results_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.PredictResponse + .PredictionResult>(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + recommendationToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + itemsMissingInCatalog_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + itemsMissingInCatalog_.add(s); + break; + } + case 32: + { + dryRun_ = input.readBool(); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + itemsMissingInCatalog_ = itemsMissingInCatalog_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.class, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.Builder.class); + } + + public interface PredictionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * ID of the recommended catalog item
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * ID of the recommended catalog item
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + int getItemMetadataCount(); + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + boolean containsItemMetadata(java.lang.String key); + /** Use {@link #getItemMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getItemMetadata(); + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + java.util.Map getItemMetadataMap(); + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + com.google.protobuf.Value getItemMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + com.google.protobuf.Value getItemMetadataOrThrow(java.lang.String key); + } + /** + * + * + *
+   * PredictionResult represents the recommendation prediction results.
+   * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult} + */ + public static final class PredictionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) + PredictionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictionResult.newBuilder() to construct. + private PredictionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictionResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictionResult( + 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(); + + id_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + itemMetadata_ = + com.google.protobuf.MapField.newMapField( + ItemMetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + itemMetadata__ = + input.readMessage( + ItemMetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + itemMetadata_ + .getMutableMap() + .put(itemMetadata__.getKey(), itemMetadata__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetItemMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.class, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + .class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * ID of the recommended catalog item
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * ID of the recommended catalog item
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEM_METADATA_FIELD_NUMBER = 2; + + private static final class ItemMetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_ItemMetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField itemMetadata_; + + private com.google.protobuf.MapField + internalGetItemMetadata() { + if (itemMetadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ItemMetadataDefaultEntryHolder.defaultEntry); + } + return itemMetadata_; + } + + public int getItemMetadataCount() { + return internalGetItemMetadata().getMap().size(); + } + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public boolean containsItemMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetItemMetadata().getMap().containsKey(key); + } + /** Use {@link #getItemMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getItemMetadata() { + return getItemMetadataMap(); + } + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public java.util.Map getItemMetadataMap() { + return internalGetItemMetadata().getMap(); + } + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public com.google.protobuf.Value getItemMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetItemMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional item metadata / annotations.
+     * Possible values:
+     * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+     *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnItemScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public com.google.protobuf.Value getItemMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetItemMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetItemMetadata(), ItemMetadataDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + for (java.util.Map.Entry entry : + internalGetItemMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry itemMetadata__ = + ItemMetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, itemMetadata__); + } + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult other = + (com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) obj; + + if (!getId().equals(other.getId())) return false; + if (!internalGetItemMetadata().equals(other.internalGetItemMetadata())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (!internalGetItemMetadata().getMap().isEmpty()) { + hash = (37 * hash) + ITEM_METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetItemMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult 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; + } + /** + * + * + *
+     * PredictionResult represents the recommendation prediction results.
+     * 
+ * + * Protobuf type {@code + * google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetItemMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableItemMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .class, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.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(); + id_ = ""; + + internalGetMutableItemMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + build() { + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult result = + new com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult( + this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + result.itemMetadata_ = internalGetItemMetadata(); + result.itemMetadata_.makeImmutable(); + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + internalGetMutableItemMetadata().mergeFrom(other.internalGetItemMetadata()); + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * ID of the recommended catalog item
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * ID of the recommended catalog item
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * ID of the recommended catalog item
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * ID of the recommended catalog item
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * ID of the recommended catalog item
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + itemMetadata_; + + private com.google.protobuf.MapField + internalGetItemMetadata() { + if (itemMetadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ItemMetadataDefaultEntryHolder.defaultEntry); + } + return itemMetadata_; + } + + private com.google.protobuf.MapField + internalGetMutableItemMetadata() { + onChanged(); + ; + if (itemMetadata_ == null) { + itemMetadata_ = + com.google.protobuf.MapField.newMapField(ItemMetadataDefaultEntryHolder.defaultEntry); + } + if (!itemMetadata_.isMutable()) { + itemMetadata_ = itemMetadata_.copy(); + } + return itemMetadata_; + } + + public int getItemMetadataCount() { + return internalGetItemMetadata().getMap().size(); + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public boolean containsItemMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetItemMetadata().getMap().containsKey(key); + } + /** Use {@link #getItemMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getItemMetadata() { + return getItemMetadataMap(); + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public java.util.Map getItemMetadataMap() { + return internalGetItemMetadata().getMap(); + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public com.google.protobuf.Value getItemMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetItemMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public com.google.protobuf.Value getItemMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetItemMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearItemMetadata() { + internalGetMutableItemMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public Builder removeItemMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableItemMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableItemMetadata() { + return internalGetMutableItemMetadata().getMutableMap(); + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public Builder putItemMetadata(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableItemMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Additional item metadata / annotations.
+       * Possible values:
+       * * `catalogItem`: JSON representation of the catalogItem. Will be set if
+       *   `returnCatalogItem` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnItemScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> item_metadata = 2; + */ + public Builder putAllItemMetadata( + java.util.Map values) { + internalGetMutableItemMetadata().getMutableMap().putAll(values); + 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.recommendationengine.v1beta1.PredictResponse.PredictionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult) + private static final com.google.cloud.recommendationengine.v1beta1.PredictResponse + .PredictionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictionResult(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.recommendationengine.v1beta1.PredictResponse.PredictionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> + results_; + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictResponse + .PredictionResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult getResults( + int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int RECOMMENDATION_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object recommendationToken_; + /** + * + * + *
+   * A unique recommendation token. This should be included in the user event
+   * logs resulting from this recommendation, which enables accurate attribution
+   * of recommendation model performance.
+   * 
+ * + * string recommendation_token = 2; + * + * @return The recommendationToken. + */ + public java.lang.String getRecommendationToken() { + java.lang.Object ref = recommendationToken_; + 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(); + recommendationToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique recommendation token. This should be included in the user event
+   * logs resulting from this recommendation, which enables accurate attribution
+   * of recommendation model performance.
+   * 
+ * + * string recommendation_token = 2; + * + * @return The bytes for recommendationToken. + */ + public com.google.protobuf.ByteString getRecommendationTokenBytes() { + java.lang.Object ref = recommendationToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recommendationToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_MISSING_IN_CATALOG_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList itemsMissingInCatalog_; + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return A list containing the itemsMissingInCatalog. + */ + public com.google.protobuf.ProtocolStringList getItemsMissingInCatalogList() { + return itemsMissingInCatalog_; + } + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return The count of itemsMissingInCatalog. + */ + public int getItemsMissingInCatalogCount() { + return itemsMissingInCatalog_.size(); + } + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index of the element to return. + * @return The itemsMissingInCatalog at the given index. + */ + public java.lang.String getItemsMissingInCatalog(int index) { + return itemsMissingInCatalog_.get(index); + } + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index of the value to return. + * @return The bytes of the itemsMissingInCatalog at the given index. + */ + public com.google.protobuf.ByteString getItemsMissingInCatalogBytes(int index) { + return itemsMissingInCatalog_.getByteString(index); + } + + public static final int DRY_RUN_FIELD_NUMBER = 4; + private boolean dryRun_; + /** + * + * + *
+   * True if the dryRun property was set in the request.
+   * 
+ * + * bool dry_run = 4; + * + * @return The dryRun. + */ + public boolean getDryRun() { + return dryRun_; + } + + public static final int METADATA_FIELD_NUMBER = 5; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public com.google.protobuf.Value getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's PredictRequest.page_token.
+   * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's PredictRequest.page_token.
+   * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + if (!getRecommendationTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recommendationToken_); + } + for (int i = 0; i < itemsMissingInCatalog_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, itemsMissingInCatalog_.getRaw(i)); + } + if (dryRun_ != false) { + output.writeBool(4, dryRun_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 5); + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); + } + if (!getRecommendationTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, recommendationToken_); + } + { + int dataSize = 0; + for (int i = 0; i < itemsMissingInCatalog_.size(); i++) { + dataSize += computeStringSizeNoTag(itemsMissingInCatalog_.getRaw(i)); + } + size += dataSize; + size += 1 * getItemsMissingInCatalogList().size(); + } + if (dryRun_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, dryRun_); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, metadata__); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, nextPageToken_); + } + 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.recommendationengine.v1beta1.PredictResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PredictResponse other = + (com.google.cloud.recommendationengine.v1beta1.PredictResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getRecommendationToken().equals(other.getRecommendationToken())) return false; + if (!getItemsMissingInCatalogList().equals(other.getItemsMissingInCatalogList())) return false; + if (getDryRun() != other.getDryRun()) return false; + if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (37 * hash) + RECOMMENDATION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRecommendationToken().hashCode(); + if (getItemsMissingInCatalogCount() > 0) { + hash = (37 * hash) + ITEMS_MISSING_IN_CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getItemsMissingInCatalogList().hashCode(); + } + hash = (37 * hash) + DRY_RUN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDryRun()); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse 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.recommendationengine.v1beta1.PredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse 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.recommendationengine.v1beta1.PredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse 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.recommendationengine.v1beta1.PredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse 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.recommendationengine.v1beta1.PredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse 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.recommendationengine.v1beta1.PredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for predict method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PredictResponse) + com.google.cloud.recommendationengine.v1beta1.PredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.class, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.PredictResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + recommendationToken_ = ""; + + itemsMissingInCatalog_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + dryRun_ = false; + + internalGetMutableMetadata().clear(); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictResponse build() { + com.google.cloud.recommendationengine.v1beta1.PredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictResponse buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PredictResponse result = + new com.google.cloud.recommendationengine.v1beta1.PredictResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.recommendationToken_ = recommendationToken_; + if (((bitField0_ & 0x00000002) != 0)) { + itemsMissingInCatalog_ = itemsMissingInCatalog_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.itemsMissingInCatalog_ = itemsMissingInCatalog_; + result.dryRun_ = dryRun_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + result.nextPageToken_ = nextPageToken_; + 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.recommendationengine.v1beta1.PredictResponse) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.PredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.PredictResponse other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PredictResponse.getDefaultInstance()) + return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (!other.getRecommendationToken().isEmpty()) { + recommendationToken_ = other.recommendationToken_; + onChanged(); + } + if (!other.itemsMissingInCatalog_.isEmpty()) { + if (itemsMissingInCatalog_.isEmpty()) { + itemsMissingInCatalog_ = other.itemsMissingInCatalog_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsMissingInCatalogIsMutable(); + itemsMissingInCatalog_.addAll(other.itemsMissingInCatalog_); + } + onChanged(); + } + if (other.getDryRun() != false) { + setDryRun(other.getDryRun()); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.PredictResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PredictResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult>( + results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictResponse + .PredictionResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended items. The order represents the ranking (from the
+     * most relevant item to the least).
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder> + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.Builder, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult, + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + .Builder, + com.google.cloud.recommendationengine.v1beta1.PredictResponse + .PredictionResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.lang.Object recommendationToken_ = ""; + /** + * + * + *
+     * A unique recommendation token. This should be included in the user event
+     * logs resulting from this recommendation, which enables accurate attribution
+     * of recommendation model performance.
+     * 
+ * + * string recommendation_token = 2; + * + * @return The recommendationToken. + */ + public java.lang.String getRecommendationToken() { + java.lang.Object ref = recommendationToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recommendationToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique recommendation token. This should be included in the user event
+     * logs resulting from this recommendation, which enables accurate attribution
+     * of recommendation model performance.
+     * 
+ * + * string recommendation_token = 2; + * + * @return The bytes for recommendationToken. + */ + public com.google.protobuf.ByteString getRecommendationTokenBytes() { + java.lang.Object ref = recommendationToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recommendationToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique recommendation token. This should be included in the user event
+     * logs resulting from this recommendation, which enables accurate attribution
+     * of recommendation model performance.
+     * 
+ * + * string recommendation_token = 2; + * + * @param value The recommendationToken to set. + * @return This builder for chaining. + */ + public Builder setRecommendationToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recommendationToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique recommendation token. This should be included in the user event
+     * logs resulting from this recommendation, which enables accurate attribution
+     * of recommendation model performance.
+     * 
+ * + * string recommendation_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecommendationToken() { + + recommendationToken_ = getDefaultInstance().getRecommendationToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique recommendation token. This should be included in the user event
+     * logs resulting from this recommendation, which enables accurate attribution
+     * of recommendation model performance.
+     * 
+ * + * string recommendation_token = 2; + * + * @param value The bytes for recommendationToken to set. + * @return This builder for chaining. + */ + public Builder setRecommendationTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recommendationToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList itemsMissingInCatalog_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureItemsMissingInCatalogIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + itemsMissingInCatalog_ = + new com.google.protobuf.LazyStringArrayList(itemsMissingInCatalog_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return A list containing the itemsMissingInCatalog. + */ + public com.google.protobuf.ProtocolStringList getItemsMissingInCatalogList() { + return itemsMissingInCatalog_.getUnmodifiableView(); + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return The count of itemsMissingInCatalog. + */ + public int getItemsMissingInCatalogCount() { + return itemsMissingInCatalog_.size(); + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index of the element to return. + * @return The itemsMissingInCatalog at the given index. + */ + public java.lang.String getItemsMissingInCatalog(int index) { + return itemsMissingInCatalog_.get(index); + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index of the value to return. + * @return The bytes of the itemsMissingInCatalog at the given index. + */ + public com.google.protobuf.ByteString getItemsMissingInCatalogBytes(int index) { + return itemsMissingInCatalog_.getByteString(index); + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index to set the value at. + * @param value The itemsMissingInCatalog to set. + * @return This builder for chaining. + */ + public Builder setItemsMissingInCatalog(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsMissingInCatalogIsMutable(); + itemsMissingInCatalog_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param value The itemsMissingInCatalog to add. + * @return This builder for chaining. + */ + public Builder addItemsMissingInCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsMissingInCatalogIsMutable(); + itemsMissingInCatalog_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param values The itemsMissingInCatalog to add. + * @return This builder for chaining. + */ + public Builder addAllItemsMissingInCatalog(java.lang.Iterable values) { + ensureItemsMissingInCatalogIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, itemsMissingInCatalog_); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return This builder for chaining. + */ + public Builder clearItemsMissingInCatalog() { + itemsMissingInCatalog_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of items in the request that were missing from the catalog.
+     * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param value The bytes of the itemsMissingInCatalog to add. + * @return This builder for chaining. + */ + public Builder addItemsMissingInCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureItemsMissingInCatalogIsMutable(); + itemsMissingInCatalog_.add(value); + onChanged(); + return this; + } + + private boolean dryRun_; + /** + * + * + *
+     * True if the dryRun property was set in the request.
+     * 
+ * + * bool dry_run = 4; + * + * @return The dryRun. + */ + public boolean getDryRun() { + return dryRun_; + } + /** + * + * + *
+     * True if the dryRun property was set in the request.
+     * 
+ * + * bool dry_run = 4; + * + * @param value The dryRun to set. + * @return This builder for chaining. + */ + public Builder setDryRun(boolean value) { + + dryRun_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the dryRun property was set in the request.
+     * 
+ * + * bool dry_run = 4; + * + * @return This builder for chaining. + */ + public Builder clearDryRun() { + + dryRun_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public com.google.protobuf.Value getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public Builder putMetadata(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional domain specific prediction response metadata.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's PredictRequest.page_token.
+     * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's PredictRequest.page_token.
+     * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's PredictRequest.page_token.
+     * 
+ * + * string next_page_token = 6; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's PredictRequest.page_token.
+     * 
+ * + * string next_page_token = 6; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, the list is complete. If nonempty, the token to pass to the next
+     * request's PredictRequest.page_token.
+     * 
+ * + * string next_page_token = 6; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.recommendationengine.v1beta1.PredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PredictResponse) + private static final com.google.cloud.recommendationengine.v1beta1.PredictResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.PredictResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictResponse(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.recommendationengine.v1beta1.PredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictResponseOrBuilder.java new file mode 100644 index 00000000..805814e7 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictResponseOrBuilder.java @@ -0,0 +1,273 @@ +/* + * 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/recommendationengine/v1beta1/prediction_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + java.util.List + getResultsList(); + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult getResults( + int index); + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + int getResultsCount(); + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.PredictResponse + .PredictionResultOrBuilder> + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of recommended items. The order represents the ranking (from the
+   * most relevant item to the least).
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * + */ + com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index); + + /** + * + * + *
+   * A unique recommendation token. This should be included in the user event
+   * logs resulting from this recommendation, which enables accurate attribution
+   * of recommendation model performance.
+   * 
+ * + * string recommendation_token = 2; + * + * @return The recommendationToken. + */ + java.lang.String getRecommendationToken(); + /** + * + * + *
+   * A unique recommendation token. This should be included in the user event
+   * logs resulting from this recommendation, which enables accurate attribution
+   * of recommendation model performance.
+   * 
+ * + * string recommendation_token = 2; + * + * @return The bytes for recommendationToken. + */ + com.google.protobuf.ByteString getRecommendationTokenBytes(); + + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return A list containing the itemsMissingInCatalog. + */ + java.util.List getItemsMissingInCatalogList(); + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @return The count of itemsMissingInCatalog. + */ + int getItemsMissingInCatalogCount(); + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index of the element to return. + * @return The itemsMissingInCatalog at the given index. + */ + java.lang.String getItemsMissingInCatalog(int index); + /** + * + * + *
+   * IDs of items in the request that were missing from the catalog.
+   * 
+ * + * repeated string items_missing_in_catalog = 3; + * + * @param index The index of the value to return. + * @return The bytes of the itemsMissingInCatalog at the given index. + */ + com.google.protobuf.ByteString getItemsMissingInCatalogBytes(int index); + + /** + * + * + *
+   * True if the dryRun property was set in the request.
+   * 
+ * + * bool dry_run = 4; + * + * @return The dryRun. + */ + boolean getDryRun(); + + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + int getMetadataCount(); + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Additional domain specific prediction response metadata.
+   * 
+ * + * map<string, .google.protobuf.Value> metadata = 5; + */ + com.google.protobuf.Value getMetadataOrThrow(java.lang.String key); + + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's PredictRequest.page_token.
+   * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If empty, the list is complete. If nonempty, the token to pass to the next
+   * request's PredictRequest.page_token.
+   * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistration.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistration.java new file mode 100644 index 00000000..f9ab6bba --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistration.java @@ -0,0 +1,659 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Registered Api Key.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration} + */ +public final class PredictionApiKeyRegistration extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) + PredictionApiKeyRegistrationOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictionApiKeyRegistration.newBuilder() to construct. + private PredictionApiKeyRegistration(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictionApiKeyRegistration() { + apiKey_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictionApiKeyRegistration(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictionApiKeyRegistration( + 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(); + + apiKey_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.class, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + .class); + } + + public static final int API_KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object apiKey_; + /** + * + * + *
+   * The API key.
+   * 
+ * + * string api_key = 1; + * + * @return The apiKey. + */ + public java.lang.String getApiKey() { + java.lang.Object ref = apiKey_; + 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(); + apiKey_ = s; + return s; + } + } + /** + * + * + *
+   * The API key.
+   * 
+ * + * string api_key = 1; + * + * @return The bytes for apiKey. + */ + public com.google.protobuf.ByteString getApiKeyBytes() { + java.lang.Object ref = apiKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getApiKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, apiKey_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getApiKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, apiKey_); + } + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration other = + (com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) obj; + + if (!getApiKey().equals(other.getApiKey())) 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) + API_KEY_FIELD_NUMBER; + hash = (53 * hash) + getApiKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration 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; + } + /** + * + * + *
+   * Registered Api Key.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.class, + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.Builder + .class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration.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(); + apiKey_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApikeyRegistryService + .internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration build() { + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration result = + new com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration(this); + result.apiKey_ = apiKey_; + 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.recommendationengine.v1beta1.PredictionApiKeyRegistration) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + .getDefaultInstance()) return this; + if (!other.getApiKey().isEmpty()) { + apiKey_ = other.apiKey_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object apiKey_ = ""; + /** + * + * + *
+     * The API key.
+     * 
+ * + * string api_key = 1; + * + * @return The apiKey. + */ + public java.lang.String getApiKey() { + java.lang.Object ref = apiKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The API key.
+     * 
+ * + * string api_key = 1; + * + * @return The bytes for apiKey. + */ + public com.google.protobuf.ByteString getApiKeyBytes() { + java.lang.Object ref = apiKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The API key.
+     * 
+ * + * string api_key = 1; + * + * @param value The apiKey to set. + * @return This builder for chaining. + */ + public Builder setApiKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The API key.
+     * 
+ * + * string api_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearApiKey() { + + apiKey_ = getDefaultInstance().getApiKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * The API key.
+     * 
+ * + * string api_key = 1; + * + * @param value The bytes for apiKey to set. + * @return This builder for chaining. + */ + public Builder setApiKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiKey_ = 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.recommendationengine.v1beta1.PredictionApiKeyRegistration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) + private static final com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictionApiKeyRegistration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictionApiKeyRegistration(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.recommendationengine.v1beta1.PredictionApiKeyRegistration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrationName.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrationName.java new file mode 100644 index 00000000..e5b16631 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrationName.java @@ -0,0 +1,287 @@ +/* + * 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.recommendationengine.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class PredictionApiKeyRegistrationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String catalog; + private final String eventStore; + private final String predictionApiKeyRegistration; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getEventStore() { + return eventStore; + } + + public String getPredictionApiKeyRegistration() { + return predictionApiKeyRegistration; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private PredictionApiKeyRegistrationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + eventStore = Preconditions.checkNotNull(builder.getEventStore()); + predictionApiKeyRegistration = + Preconditions.checkNotNull(builder.getPredictionApiKeyRegistration()); + } + + public static PredictionApiKeyRegistrationName of( + String project, + String location, + String catalog, + String eventStore, + String predictionApiKeyRegistration) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setEventStore(eventStore) + .setPredictionApiKeyRegistration(predictionApiKeyRegistration) + .build(); + } + + public static String format( + String project, + String location, + String catalog, + String eventStore, + String predictionApiKeyRegistration) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setEventStore(eventStore) + .setPredictionApiKeyRegistration(predictionApiKeyRegistration) + .build() + .toString(); + } + + public static PredictionApiKeyRegistrationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "PredictionApiKeyRegistrationName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("event_store"), + matchMap.get("prediction_api_key_registration")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (PredictionApiKeyRegistrationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("catalog", catalog); + fieldMapBuilder.put("eventStore", eventStore); + fieldMapBuilder.put("predictionApiKeyRegistration", predictionApiKeyRegistration); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "event_store", + eventStore, + "prediction_api_key_registration", + predictionApiKeyRegistration); + } + + /** Builder for PredictionApiKeyRegistrationName. */ + public static class Builder { + + private String project; + private String location; + private String catalog; + private String eventStore; + private String predictionApiKeyRegistration; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getEventStore() { + return eventStore; + } + + public String getPredictionApiKeyRegistration() { + return predictionApiKeyRegistration; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public Builder setEventStore(String eventStore) { + this.eventStore = eventStore; + return this; + } + + public Builder setPredictionApiKeyRegistration(String predictionApiKeyRegistration) { + this.predictionApiKeyRegistration = predictionApiKeyRegistration; + return this; + } + + private Builder() {} + + private Builder(PredictionApiKeyRegistrationName predictionApiKeyRegistrationName) { + project = predictionApiKeyRegistrationName.project; + location = predictionApiKeyRegistrationName.location; + catalog = predictionApiKeyRegistrationName.catalog; + eventStore = predictionApiKeyRegistrationName.eventStore; + predictionApiKeyRegistration = predictionApiKeyRegistrationName.predictionApiKeyRegistration; + } + + public PredictionApiKeyRegistrationName build() { + return new PredictionApiKeyRegistrationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PredictionApiKeyRegistrationName) { + PredictionApiKeyRegistrationName that = (PredictionApiKeyRegistrationName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.catalog.equals(that.catalog)) + && (this.eventStore.equals(that.eventStore)) + && (this.predictionApiKeyRegistration.equals(that.predictionApiKeyRegistration)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= catalog.hashCode(); + h *= 1000003; + h ^= eventStore.hashCode(); + h *= 1000003; + h ^= predictionApiKeyRegistration.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrationOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrationOrBuilder.java new file mode 100644 index 00000000..b79e9622 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrationOrBuilder.java @@ -0,0 +1,50 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PredictionApiKeyRegistrationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The API key.
+   * 
+ * + * string api_key = 1; + * + * @return The apiKey. + */ + java.lang.String getApiKey(); + /** + * + * + *
+   * The API key.
+   * 
+ * + * string api_key = 1; + * + * @return The bytes for apiKey. + */ + com.google.protobuf.ByteString getApiKeyBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApikeyRegistryService.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApikeyRegistryService.java new file mode 100644 index 00000000..81572401 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApikeyRegistryService.java @@ -0,0 +1,175 @@ +/* + * 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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class PredictionApikeyRegistryService { + private PredictionApikeyRegistryService() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nRgoogle/cloud/recommendationengine/v1be" + + "ta1/prediction_apikey_registry_service.p" + + "roto\022)google.cloud.recommendationengine." + + "v1beta1\032\034google/api/annotations.proto\032\037g" + + "oogle/api/field_behavior.proto\032\033google/p" + + "rotobuf/empty.proto\032\027google/api/client.p" + + "roto\"/\n\034PredictionApiKeyRegistration\022\017\n\007" + + "api_key\030\001 \001(\t\"\262\001\n)CreatePredictionApiKey" + + "RegistrationRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002" + + "\022p\n\037prediction_api_key_registration\030\002 \001(" + + "\0132G.google.cloud.recommendationengine.v1" + + "beta1.PredictionApiKeyRegistration\"p\n(Li" + + "stPredictionApiKeyRegistrationsRequest\022\023" + + "\n\006parent\030\001 \001(\tB\003\340A\002\022\026\n\tpage_size\030\002 \001(\005B\003" + + "\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"\267\001\n)ListPre" + + "dictionApiKeyRegistrationsResponse\022q\n pr" + + "ediction_api_key_registrations\030\001 \003(\0132G.g" + + "oogle.cloud.recommendationengine.v1beta1" + + ".PredictionApiKeyRegistration\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\">\n)DeletePredictionApiKey" + + "RegistrationRequest\022\021\n\004name\030\001 \001(\tB\003\340A\0022\335" + + "\007\n\030PredictionApiKeyRegistry\022\257\002\n\"CreatePr" + + "edictionApiKeyRegistration\022T.google.clou" + + "d.recommendationengine.v1beta1.CreatePre" + + "dictionApiKeyRegistrationRequest\032G.googl" + + "e.cloud.recommendationengine.v1beta1.Pre" + + "dictionApiKeyRegistration\"j\202\323\344\223\002d\"_/v1be" + + "ta1/{parent=projects/*/locations/*/catal" + + "ogs/*/eventStores/*}/predictionApiKeyReg" + + "istrations:\001*\022\267\002\n!ListPredictionApiKeyRe" + + "gistrations\022S.google.cloud.recommendatio" + + "nengine.v1beta1.ListPredictionApiKeyRegi" + + "strationsRequest\032T.google.cloud.recommen" + + "dationengine.v1beta1.ListPredictionApiKe" + + "yRegistrationsResponse\"g\202\323\344\223\002a\022_/v1beta1" + + "/{parent=projects/*/locations/*/catalogs" + + "/*/eventStores/*}/predictionApiKeyRegist" + + "rations\022\373\001\n\"DeletePredictionApiKeyRegist" + + "ration\022T.google.cloud.recommendationengi" + + "ne.v1beta1.DeletePredictionApiKeyRegistr" + + "ationRequest\032\026.google.protobuf.Empty\"g\202\323" + + "\344\223\002a*_/v1beta1/{name=projects/*/location" + + "s/*/catalogs/*/eventStores/*/predictionA" + + "piKeyRegistrations/*}\032W\312A#recommendation" + + "engine.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformB\304\001\n-com.g" + + "oogle.cloud.recommendationengine.v1beta1" + + "P\001Z]google.golang.org/genproto/googleapi" + + "s/cloud/recommendationengine/v1beta1;rec" + + "ommendationengine\242\002\005RECAI\252\002)Google.Cloud" + + ".RecommendationEngine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictionApiKeyRegistration_descriptor, + new java.lang.String[] { + "ApiKey", + }); + internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_CreatePredictionApiKeyRegistrationRequest_descriptor, + new java.lang.String[] { + "Parent", "PredictionApiKeyRegistration", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ListPredictionApiKeyRegistrationsResponse_descriptor, + new java.lang.String[] { + "PredictionApiKeyRegistrations", "NextPageToken", + }); + internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_DeletePredictionApiKeyRegistrationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceOuterClass.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceOuterClass.java new file mode 100644 index 00000000..921c4da8 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceOuterClass.java @@ -0,0 +1,214 @@ +/* + * 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/recommendationengine/v1beta1/prediction_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class PredictionServiceOuterClass { + private PredictionServiceOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_ItemMetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_ItemMetadataEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_MetadataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nBgoogle/cloud/recommendationengine/v1be" + + "ta1/prediction_service.proto\022)google.clo" + + "ud.recommendationengine.v1beta1\032\034google/" + + "api/annotations.proto\032\037google/api/field_" + + "behavior.proto\032:google/cloud/recommendat" + + "ionengine/v1beta1/user_event.proto\032\034goog" + + "le/protobuf/struct.proto\032\027google/api/cli" + + "ent.proto\"\374\003\n\016PredictRequest\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\002\022M\n\nuser_event\030\002 \001(\01324.google.clo" + + "ud.recommendationengine.v1beta1.UserEven" + + "tB\003\340A\002\022\026\n\tpage_size\030\007 \001(\005B\003\340A\001\022\027\n\npage_t" + + "oken\030\010 \001(\tB\003\340A\001\022\023\n\006filter\030\003 \001(\tB\003\340A\001\022\024\n\007" + + "dry_run\030\004 \001(\010B\003\340A\001\022Z\n\006params\030\006 \003(\0132E.goo" + + "gle.cloud.recommendationengine.v1beta1.P" + + "redictRequest.ParamsEntryB\003\340A\001\022Z\n\006labels" + + "\030\t \003(\0132E.google.cloud.recommendationengi" + + "ne.v1beta1.PredictRequest.LabelsEntryB\003\340" + + "A\001\032E\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030" + + "\002 \001(\0132\026.google.protobuf.Value:\0028\001\032-\n\013Lab" + + "elsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "\"\342\004\n\017PredictResponse\022\\\n\007results\030\001 \003(\0132K." + + "google.cloud.recommendationengine.v1beta" + + "1.PredictResponse.PredictionResult\022\034\n\024re" + + "commendation_token\030\002 \001(\t\022 \n\030items_missin" + + "g_in_catalog\030\003 \003(\t\022\017\n\007dry_run\030\004 \001(\010\022Z\n\010m" + + "etadata\030\005 \003(\0132H.google.cloud.recommendat" + + "ionengine.v1beta1.PredictResponse.Metada" + + "taEntry\022\027\n\017next_page_token\030\006 \001(\t\032\341\001\n\020Pre" + + "dictionResult\022\n\n\002id\030\001 \001(\t\022t\n\ritem_metada" + + "ta\030\002 \003(\0132].google.cloud.recommendationen" + + "gine.v1beta1.PredictResponse.PredictionR" + + "esult.ItemMetadataEntry\032K\n\021ItemMetadataE" + + "ntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.googl" + + "e.protobuf.Value:\0028\001\032G\n\rMetadataEntry\022\013\n" + + "\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.proto" + + "buf.Value:\0028\0012\320\002\n\021PredictionService\022\341\001\n\007" + + "Predict\0229.google.cloud.recommendationeng" + + "ine.v1beta1.PredictRequest\032:.google.clou" + + "d.recommendationengine.v1beta1.PredictRe" + + "sponse\"_\202\323\344\223\002Y\"T/v1beta1/{name=projects/" + + "*/locations/*/catalogs/*/eventStores/*/p" + + "lacements/*}:predict:\001*\032W\312A#recommendati" + + "onengine.googleapis.com\322A.https://www.go" + + "ogleapis.com/auth/cloud-platformB\304\001\n-com" + + ".google.cloud.recommendationengine.v1bet" + + "a1P\001Z]google.golang.org/genproto/googlea" + + "pis/cloud/recommendationengine/v1beta1;r" + + "ecommendationengine\242\002\005RECAI\252\002)Google.Clo" + + "ud.RecommendationEngine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor, + new java.lang.String[] { + "Name", "UserEvent", "PageSize", "PageToken", "Filter", "DryRun", "Params", "Labels", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_ParamsEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_LabelsEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor, + new java.lang.String[] { + "Results", + "RecommendationToken", + "ItemsMissingInCatalog", + "DryRun", + "Metadata", + "NextPageToken", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor, + new java.lang.String[] { + "Id", "ItemMetadata", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_ItemMetadataEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_ItemMetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_PredictionResult_ItemMetadataEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_MetadataEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PredictResponse_MetadataEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductCatalogItem.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductCatalogItem.java new file mode 100644 index 00000000..fb69d722 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductCatalogItem.java @@ -0,0 +1,4347 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * ProductCatalogItem captures item metadata specific to retail products.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem} + */ +public final class ProductCatalogItem extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + ProductCatalogItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductCatalogItem.newBuilder() to construct. + private ProductCatalogItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductCatalogItem() { + currencyCode_ = ""; + stockState_ = 0; + canonicalProductUri_ = ""; + images_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductCatalogItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductCatalogItem( + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder + subBuilder = null; + if (priceCase_ == 1) { + subBuilder = + ((com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + price_) + .toBuilder(); + } + price_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + price_); + price_ = subBuilder.buildPartial(); + } + priceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder + subBuilder = null; + if (priceCase_ == 2) { + subBuilder = + ((com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + price_) + .toBuilder(); + } + price_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + price_); + price_ = subBuilder.buildPartial(); + } + priceCase_ = 2; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + costs_ = + com.google.protobuf.MapField.newMapField(CostsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry costs__ = + input.readMessage( + CostsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + costs_.getMutableMap().put(costs__.getKey(), costs__.getValue()); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + currencyCode_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + stockState_ = rawValue; + break; + } + case 48: + { + availableQuantity_ = input.readInt64(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + canonicalProductUri_ = s; + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + images_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + images_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.Image.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.class, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder.class); + } + + /** + * + * + *
+   * Item stock state. If this field is unspecified, the item is
+   * assumed to be in stock.
+   * 
+ * + * Protobuf enum {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState} + */ + public enum StockState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default item stock status. Should never be used.
+     * 
+ * + * STOCK_STATE_UNSPECIFIED = 0; + */ + STOCK_STATE_UNSPECIFIED(0, 0), + /** + * + * + *
+     * Item out of stock.
+     * 
+ * + * OUT_OF_STOCK = 1; + */ + OUT_OF_STOCK(2, 1), + /** + * + * + *
+     * Item that is in pre-order state.
+     * 
+ * + * PREORDER = 2; + */ + PREORDER(3, 2), + /** + * + * + *
+     * Item that is back-ordered (i.e. temporarily out of stock).
+     * 
+ * + * BACKORDER = 3; + */ + BACKORDER(4, 3), + UNRECOGNIZED(-1, -1), + ; + + /** + * + * + *
+     * Item in stock.
+     * 
+ * + * IN_STOCK = 0; + */ + public static final StockState IN_STOCK = STOCK_STATE_UNSPECIFIED; + /** + * + * + *
+     * Default item stock status. Should never be used.
+     * 
+ * + * STOCK_STATE_UNSPECIFIED = 0; + */ + public static final int STOCK_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Item in stock.
+     * 
+ * + * IN_STOCK = 0; + */ + public static final int IN_STOCK_VALUE = 0; + /** + * + * + *
+     * Item out of stock.
+     * 
+ * + * OUT_OF_STOCK = 1; + */ + public static final int OUT_OF_STOCK_VALUE = 1; + /** + * + * + *
+     * Item that is in pre-order state.
+     * 
+ * + * PREORDER = 2; + */ + public static final int PREORDER_VALUE = 2; + /** + * + * + *
+     * Item that is back-ordered (i.e. temporarily out of stock).
+     * 
+ * + * BACKORDER = 3; + */ + public static final int BACKORDER_VALUE = 3; + + public final int getNumber() { + if (index == -1) { + 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 StockState 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 StockState forNumber(int value) { + switch (value) { + case 0: + return STOCK_STATE_UNSPECIFIED; + case 1: + return OUT_OF_STOCK; + case 2: + return PREORDER; + case 3: + return BACKORDER; + 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 StockState findValueByNumber(int number) { + return StockState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final StockState[] VALUES = { + STOCK_STATE_UNSPECIFIED, IN_STOCK, OUT_OF_STOCK, PREORDER, BACKORDER, + }; + + public static StockState 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 index; + private final int value; + + private StockState(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState) + } + + public interface ExactPriceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. Display price of the product.
+     * 
+ * + * float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayPrice. + */ + float getDisplayPrice(); + + /** + * + * + *
+     * Optional. Price of the product without any discount. If zero, by default
+     * set to be the 'displayPrice'.
+     * 
+ * + * float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The originalPrice. + */ + float getOriginalPrice(); + } + /** + * + * + *
+   * Exact product price.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice} + */ + public static final class ExactPrice extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + ExactPriceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExactPrice.newBuilder() to construct. + private ExactPrice(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExactPrice() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExactPrice(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExactPrice( + 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 13: + { + displayPrice_ = input.readFloat(); + break; + } + case 21: + { + originalPrice_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.class, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder + .class); + } + + public static final int DISPLAY_PRICE_FIELD_NUMBER = 1; + private float displayPrice_; + /** + * + * + *
+     * Optional. Display price of the product.
+     * 
+ * + * float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayPrice. + */ + public float getDisplayPrice() { + return displayPrice_; + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 2; + private float originalPrice_; + /** + * + * + *
+     * Optional. Price of the product without any discount. If zero, by default
+     * set to be the 'displayPrice'.
+     * 
+ * + * float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The originalPrice. + */ + public float getOriginalPrice() { + return originalPrice_; + } + + 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 (displayPrice_ != 0F) { + output.writeFloat(1, displayPrice_); + } + if (originalPrice_ != 0F) { + output.writeFloat(2, originalPrice_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (displayPrice_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, displayPrice_); + } + if (originalPrice_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, originalPrice_); + } + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice other = + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) obj; + + if (java.lang.Float.floatToIntBits(getDisplayPrice()) + != java.lang.Float.floatToIntBits(other.getDisplayPrice())) return false; + if (java.lang.Float.floatToIntBits(getOriginalPrice()) + != java.lang.Float.floatToIntBits(other.getOriginalPrice())) 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) + DISPLAY_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getDisplayPrice()); + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalPrice()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice 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; + } + /** + * + * + *
+     * Exact product price.
+     * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.class, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder + .class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.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(); + displayPrice_ = 0F; + + originalPrice_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_ExactPrice_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice build() { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice result = + new com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice(this); + result.displayPrice_ = displayPrice_; + result.originalPrice_ = originalPrice_; + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance()) return this; + if (other.getDisplayPrice() != 0F) { + setDisplayPrice(other.getDisplayPrice()); + } + if (other.getOriginalPrice() != 0F) { + setOriginalPrice(other.getOriginalPrice()); + } + 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float displayPrice_; + /** + * + * + *
+       * Optional. Display price of the product.
+       * 
+ * + * float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayPrice. + */ + public float getDisplayPrice() { + return displayPrice_; + } + /** + * + * + *
+       * Optional. Display price of the product.
+       * 
+ * + * float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayPrice to set. + * @return This builder for chaining. + */ + public Builder setDisplayPrice(float value) { + + displayPrice_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Display price of the product.
+       * 
+ * + * float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayPrice() { + + displayPrice_ = 0F; + onChanged(); + return this; + } + + private float originalPrice_; + /** + * + * + *
+       * Optional. Price of the product without any discount. If zero, by default
+       * set to be the 'displayPrice'.
+       * 
+ * + * float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The originalPrice. + */ + public float getOriginalPrice() { + return originalPrice_; + } + /** + * + * + *
+       * Optional. Price of the product without any discount. If zero, by default
+       * set to be the 'displayPrice'.
+       * 
+ * + * float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The originalPrice to set. + * @return This builder for chaining. + */ + public Builder setOriginalPrice(float value) { + + originalPrice_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Price of the product without any discount. If zero, by default
+       * set to be the 'displayPrice'.
+       * 
+ * + * float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOriginalPrice() { + + originalPrice_ = 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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + private static final com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExactPrice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExactPrice(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.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PriceRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The minimum product price.
+     * 
+ * + * float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The min. + */ + float getMin(); + + /** + * + * + *
+     * Required. The maximum product price.
+     * 
+ * + * float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The max. + */ + float getMax(); + } + /** + * + * + *
+   * Product price range when there are a range of prices for different
+   * variations of the same product.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange} + */ + public static final class PriceRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + PriceRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use PriceRange.newBuilder() to construct. + private PriceRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PriceRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PriceRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PriceRange( + 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 13: + { + min_ = input.readFloat(); + break; + } + case 21: + { + max_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.class, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder + .class); + } + + public static final int MIN_FIELD_NUMBER = 1; + private float min_; + /** + * + * + *
+     * Required. The minimum product price.
+     * 
+ * + * float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The min. + */ + public float getMin() { + return min_; + } + + public static final int MAX_FIELD_NUMBER = 2; + private float max_; + /** + * + * + *
+     * Required. The maximum product price.
+     * 
+ * + * float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The max. + */ + public float getMax() { + return max_; + } + + 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 (min_ != 0F) { + output.writeFloat(1, min_); + } + if (max_ != 0F) { + output.writeFloat(2, max_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (min_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, min_); + } + if (max_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, max_); + } + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange other = + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) obj; + + if (java.lang.Float.floatToIntBits(getMin()) + != java.lang.Float.floatToIntBits(other.getMin())) return false; + if (java.lang.Float.floatToIntBits(getMax()) + != java.lang.Float.floatToIntBits(other.getMax())) 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) + MIN_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMin()); + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMax()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange 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; + } + /** + * + * + *
+     * Product price range when there are a range of prices for different
+     * variations of the same product.
+     * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.class, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder + .class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.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(); + min_ = 0F; + + max_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_PriceRange_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange build() { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange result = + new com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange(this); + result.min_ = min_; + result.max_ = max_; + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance()) return this; + if (other.getMin() != 0F) { + setMin(other.getMin()); + } + if (other.getMax() != 0F) { + setMax(other.getMax()); + } + 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float min_; + /** + * + * + *
+       * Required. The minimum product price.
+       * 
+ * + * float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The min. + */ + public float getMin() { + return min_; + } + /** + * + * + *
+       * Required. The minimum product price.
+       * 
+ * + * float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The min to set. + * @return This builder for chaining. + */ + public Builder setMin(float value) { + + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The minimum product price.
+       * 
+ * + * float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMin() { + + min_ = 0F; + onChanged(); + return this; + } + + private float max_; + /** + * + * + *
+       * Required. The maximum product price.
+       * 
+ * + * float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The max. + */ + public float getMax() { + return max_; + } + /** + * + * + *
+       * Required. The maximum product price.
+       * 
+ * + * float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The max to set. + * @return This builder for chaining. + */ + public Builder setMax(float value) { + + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The maximum product price.
+       * 
+ * + * float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMax() { + + max_ = 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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + private static final com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PriceRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PriceRange(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.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int priceCase_ = 0; + private java.lang.Object price_; + + public enum PriceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXACT_PRICE(1), + PRICE_RANGE(2), + PRICE_NOT_SET(0); + private final int value; + + private PriceCase(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 PriceCase valueOf(int value) { + return forNumber(value); + } + + public static PriceCase forNumber(int value) { + switch (value) { + case 1: + return EXACT_PRICE; + case 2: + return PRICE_RANGE; + case 0: + return PRICE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PriceCase getPriceCase() { + return PriceCase.forNumber(priceCase_); + } + + public static final int EXACT_PRICE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Optional. The exact product price.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exactPrice field is set. + */ + public boolean hasExactPrice() { + return priceCase_ == 1; + } + /** + * + * + *
+   * Optional. The exact product price.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exactPrice. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + getExactPrice() { + if (priceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } + /** + * + * + *
+   * Optional. The exact product price.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceOrBuilder + getExactPriceOrBuilder() { + if (priceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } + + public static final int PRICE_RANGE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Optional. The product price range.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the priceRange field is set. + */ + public boolean hasPriceRange() { + return priceCase_ == 2; + } + /** + * + * + *
+   * Optional. The product price range.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The priceRange. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + getPriceRange() { + if (priceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } + /** + * + * + *
+   * Optional. The product price range.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeOrBuilder + getPriceRangeOrBuilder() { + if (priceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } + + public static final int COSTS_FIELD_NUMBER = 3; + + private static final class CostsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_CostsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.FLOAT, + 0F); + } + + private com.google.protobuf.MapField costs_; + + private com.google.protobuf.MapField internalGetCosts() { + if (costs_ == null) { + return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry); + } + return costs_; + } + + public int getCostsCount() { + return internalGetCosts().getMap().size(); + } + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsCosts(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetCosts().getMap().containsKey(key); + } + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getCosts() { + return getCostsMap(); + } + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getCostsMap() { + return internalGetCosts().getMap(); + } + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 4; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * Optional. Only required if the price is set. Currency code for price/costs. Use
+   * three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Only required if the price is set. Currency code for price/costs. Use
+   * three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STOCK_STATE_FIELD_NUMBER = 5; + private int stockState_; + /** + * + * + *
+   * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for stockState. + */ + public int getStockStateValue() { + return stockState_; + } + /** + * + * + *
+   * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stockState. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + getStockState() { + @SuppressWarnings("deprecation") + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState result = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.valueOf( + stockState_); + return result == null + ? com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.UNRECOGNIZED + : result; + } + + public static final int AVAILABLE_QUANTITY_FIELD_NUMBER = 6; + private long availableQuantity_; + /** + * + * + *
+   * Optional. The available quantity of the item.
+   * 
+ * + * int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The availableQuantity. + */ + public long getAvailableQuantity() { + return availableQuantity_; + } + + public static final int CANONICAL_PRODUCT_URI_FIELD_NUMBER = 7; + private volatile java.lang.Object canonicalProductUri_; + /** + * + * + *
+   * Optional. Canonical URL directly linking to the item detail page with a
+   * length limit of 5 KiB..
+   * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The canonicalProductUri. + */ + public java.lang.String getCanonicalProductUri() { + java.lang.Object ref = canonicalProductUri_; + 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(); + canonicalProductUri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Canonical URL directly linking to the item detail page with a
+   * length limit of 5 KiB..
+   * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for canonicalProductUri. + */ + public com.google.protobuf.ByteString getCanonicalProductUriBytes() { + java.lang.Object ref = canonicalProductUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalProductUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGES_FIELD_NUMBER = 8; + private java.util.List images_; + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getImagesList() { + return images_; + } + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getImagesOrBuilderList() { + return images_; + } + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getImagesCount() { + return images_.size(); + } + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.Image getImages(int index) { + return images_.get(index); + } + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder getImagesOrBuilder( + int index) { + return images_.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 (priceCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) price_); + } + if (priceCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) price_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetCosts(), CostsDefaultEntryHolder.defaultEntry, 3); + if (!getCurrencyCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, currencyCode_); + } + if (stockState_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + .STOCK_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, stockState_); + } + if (availableQuantity_ != 0L) { + output.writeInt64(6, availableQuantity_); + } + if (!getCanonicalProductUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, canonicalProductUri_); + } + for (int i = 0; i < images_.size(); i++) { + output.writeMessage(8, images_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (priceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) price_); + } + if (priceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) price_); + } + for (java.util.Map.Entry entry : + internalGetCosts().getMap().entrySet()) { + com.google.protobuf.MapEntry costs__ = + CostsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, costs__); + } + if (!getCurrencyCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, currencyCode_); + } + if (stockState_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + .STOCK_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, stockState_); + } + if (availableQuantity_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, availableQuantity_); + } + if (!getCanonicalProductUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, canonicalProductUri_); + } + for (int i = 0; i < images_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, images_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem other = + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) obj; + + if (!internalGetCosts().equals(other.internalGetCosts())) return false; + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + if (stockState_ != other.stockState_) return false; + if (getAvailableQuantity() != other.getAvailableQuantity()) return false; + if (!getCanonicalProductUri().equals(other.getCanonicalProductUri())) return false; + if (!getImagesList().equals(other.getImagesList())) return false; + if (!getPriceCase().equals(other.getPriceCase())) return false; + switch (priceCase_) { + case 1: + if (!getExactPrice().equals(other.getExactPrice())) return false; + break; + case 2: + if (!getPriceRange().equals(other.getPriceRange())) 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(); + if (!internalGetCosts().getMap().isEmpty()) { + hash = (37 * hash) + COSTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetCosts().hashCode(); + } + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (37 * hash) + STOCK_STATE_FIELD_NUMBER; + hash = (53 * hash) + stockState_; + hash = (37 * hash) + AVAILABLE_QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAvailableQuantity()); + hash = (37 * hash) + CANONICAL_PRODUCT_URI_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalProductUri().hashCode(); + if (getImagesCount() > 0) { + hash = (37 * hash) + IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getImagesList().hashCode(); + } + switch (priceCase_) { + case 1: + hash = (37 * hash) + EXACT_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getExactPrice().hashCode(); + break; + case 2: + hash = (37 * hash) + PRICE_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getPriceRange().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem 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.recommendationengine.v1beta1.ProductCatalogItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem 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.recommendationengine.v1beta1.ProductCatalogItem parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem 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.recommendationengine.v1beta1.ProductCatalogItem parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem 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.recommendationengine.v1beta1.ProductCatalogItem parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem 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.recommendationengine.v1beta1.ProductCatalogItem 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; + } + /** + * + * + *
+   * ProductCatalogItem captures item metadata specific to retail products.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductCatalogItem} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.class, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getImagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableCosts().clear(); + currencyCode_ = ""; + + stockState_ = 0; + + availableQuantity_ = 0L; + + canonicalProductUri_ = ""; + + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + imagesBuilder_.clear(); + } + priceCase_ = 0; + price_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Catalog + .internal_static_google_cloud_recommendationengine_v1beta1_ProductCatalogItem_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem build() { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem result = + new com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem(this); + int from_bitField0_ = bitField0_; + if (priceCase_ == 1) { + if (exactPriceBuilder_ == null) { + result.price_ = price_; + } else { + result.price_ = exactPriceBuilder_.build(); + } + } + if (priceCase_ == 2) { + if (priceRangeBuilder_ == null) { + result.price_ = price_; + } else { + result.price_ = priceRangeBuilder_.build(); + } + } + result.costs_ = internalGetCosts(); + result.costs_.makeImmutable(); + result.currencyCode_ = currencyCode_; + result.stockState_ = stockState_; + result.availableQuantity_ = availableQuantity_; + result.canonicalProductUri_ = canonicalProductUri_; + if (imagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.images_ = images_; + } else { + result.images_ = imagesBuilder_.build(); + } + result.priceCase_ = priceCase_; + 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.recommendationengine.v1beta1.ProductCatalogItem) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.getDefaultInstance()) + return this; + internalGetMutableCosts().mergeFrom(other.internalGetCosts()); + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + onChanged(); + } + if (other.stockState_ != 0) { + setStockStateValue(other.getStockStateValue()); + } + if (other.getAvailableQuantity() != 0L) { + setAvailableQuantity(other.getAvailableQuantity()); + } + if (!other.getCanonicalProductUri().isEmpty()) { + canonicalProductUri_ = other.canonicalProductUri_; + onChanged(); + } + if (imagesBuilder_ == null) { + if (!other.images_.isEmpty()) { + if (images_.isEmpty()) { + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureImagesIsMutable(); + images_.addAll(other.images_); + } + onChanged(); + } + } else { + if (!other.images_.isEmpty()) { + if (imagesBuilder_.isEmpty()) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000002); + imagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getImagesFieldBuilder() + : null; + } else { + imagesBuilder_.addAllMessages(other.images_); + } + } + } + switch (other.getPriceCase()) { + case EXACT_PRICE: + { + mergeExactPrice(other.getExactPrice()); + break; + } + case PRICE_RANGE: + { + mergePriceRange(other.getPriceRange()); + break; + } + case PRICE_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.recommendationengine.v1beta1.ProductCatalogItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int priceCase_ = 0; + private java.lang.Object price_; + + public PriceCase getPriceCase() { + return PriceCase.forNumber(priceCase_); + } + + public Builder clearPrice() { + priceCase_ = 0; + price_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceOrBuilder> + exactPriceBuilder_; + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exactPrice field is set. + */ + public boolean hasExactPrice() { + return priceCase_ == 1; + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exactPrice. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + getExactPrice() { + if (exactPriceBuilder_ == null) { + if (priceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } else { + if (priceCase_ == 1) { + return exactPriceBuilder_.getMessage(); + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExactPrice( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice value) { + if (exactPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + onChanged(); + } else { + exactPriceBuilder_.setMessage(value); + } + priceCase_ = 1; + return this; + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExactPrice( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder + builderForValue) { + if (exactPriceBuilder_ == null) { + price_ = builderForValue.build(); + onChanged(); + } else { + exactPriceBuilder_.setMessage(builderForValue.build()); + } + priceCase_ = 1; + return this; + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExactPrice( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice value) { + if (exactPriceBuilder_ == null) { + if (priceCase_ == 1 + && price_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance()) { + price_ = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .newBuilder( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + price_) + .mergeFrom(value) + .buildPartial(); + } else { + price_ = value; + } + onChanged(); + } else { + if (priceCase_ == 1) { + exactPriceBuilder_.mergeFrom(value); + } + exactPriceBuilder_.setMessage(value); + } + priceCase_ = 1; + return this; + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExactPrice() { + if (exactPriceBuilder_ == null) { + if (priceCase_ == 1) { + priceCase_ = 0; + price_ = null; + onChanged(); + } + } else { + if (priceCase_ == 1) { + priceCase_ = 0; + price_ = null; + } + exactPriceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder + getExactPriceBuilder() { + return getExactPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceOrBuilder + getExactPriceOrBuilder() { + if ((priceCase_ == 1) && (exactPriceBuilder_ != null)) { + return exactPriceBuilder_.getMessageOrBuilder(); + } else { + if (priceCase_ == 1) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. The exact product price.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceOrBuilder> + getExactPriceFieldBuilder() { + if (exactPriceBuilder_ == null) { + if (!(priceCase_ == 1)) { + price_ = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + .getDefaultInstance(); + } + exactPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + .ExactPriceOrBuilder>( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice) + price_, + getParentForChildren(), + isClean()); + price_ = null; + } + priceCase_ = 1; + onChanged(); + ; + return exactPriceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeOrBuilder> + priceRangeBuilder_; + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the priceRange field is set. + */ + public boolean hasPriceRange() { + return priceCase_ == 2; + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The priceRange. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + getPriceRange() { + if (priceRangeBuilder_ == null) { + if (priceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } else { + if (priceCase_ == 2) { + return priceRangeBuilder_.getMessage(); + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPriceRange( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + onChanged(); + } else { + priceRangeBuilder_.setMessage(value); + } + priceCase_ = 2; + return this; + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPriceRange( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder + builderForValue) { + if (priceRangeBuilder_ == null) { + price_ = builderForValue.build(); + onChanged(); + } else { + priceRangeBuilder_.setMessage(builderForValue.build()); + } + priceCase_ = 2; + return this; + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePriceRange( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (priceCase_ == 2 + && price_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance()) { + price_ = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .newBuilder( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + price_) + .mergeFrom(value) + .buildPartial(); + } else { + price_ = value; + } + onChanged(); + } else { + if (priceCase_ == 2) { + priceRangeBuilder_.mergeFrom(value); + } + priceRangeBuilder_.setMessage(value); + } + priceCase_ = 2; + return this; + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPriceRange() { + if (priceRangeBuilder_ == null) { + if (priceCase_ == 2) { + priceCase_ = 0; + price_ = null; + onChanged(); + } + } else { + if (priceCase_ == 2) { + priceCase_ = 0; + price_ = null; + } + priceRangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder + getPriceRangeBuilder() { + return getPriceRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeOrBuilder + getPriceRangeOrBuilder() { + if ((priceCase_ == 2) && (priceRangeBuilder_ != null)) { + return priceRangeBuilder_.getMessageOrBuilder(); + } else { + if (priceCase_ == 2) { + return (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + price_; + } + return com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. The product price range.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeOrBuilder> + getPriceRangeFieldBuilder() { + if (priceRangeBuilder_ == null) { + if (!(priceCase_ == 2)) { + price_ = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + .getDefaultInstance(); + } + priceRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + .PriceRangeOrBuilder>( + (com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange) + price_, + getParentForChildren(), + isClean()); + price_ = null; + } + priceCase_ = 2; + onChanged(); + ; + return priceRangeBuilder_; + } + + private com.google.protobuf.MapField costs_; + + private com.google.protobuf.MapField internalGetCosts() { + if (costs_ == null) { + return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry); + } + return costs_; + } + + private com.google.protobuf.MapField + internalGetMutableCosts() { + onChanged(); + ; + if (costs_ == null) { + costs_ = com.google.protobuf.MapField.newMapField(CostsDefaultEntryHolder.defaultEntry); + } + if (!costs_.isMutable()) { + costs_ = costs_.copy(); + } + return costs_; + } + + public int getCostsCount() { + return internalGetCosts().getMap().size(); + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsCosts(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetCosts().getMap().containsKey(key); + } + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getCosts() { + return getCostsMap(); + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getCostsMap() { + return internalGetCosts().getMap(); + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCosts() { + internalGetMutableCosts().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeCosts(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableCosts().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableCosts() { + return internalGetMutableCosts().getMutableMap(); + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putCosts(java.lang.String key, float value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + + internalGetMutableCosts().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. A map to pass the costs associated with the product.
+     * For example:
+     * {"manufacturing": 45.5} The profit of selling this item is computed like
+     * so:
+     * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+     * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+     * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllCosts(java.util.Map values) { + internalGetMutableCosts().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * Optional. Only required if the price is set. Currency code for price/costs. Use
+     * three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Only required if the price is set. Currency code for price/costs. Use
+     * three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Only required if the price is set. Currency code for price/costs. Use
+     * three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Only required if the price is set. Currency code for price/costs. Use
+     * three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Only required if the price is set. Currency code for price/costs. Use
+     * three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = value; + onChanged(); + return this; + } + + private int stockState_ = 0; + /** + * + * + *
+     * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for stockState. + */ + public int getStockStateValue() { + return stockState_; + } + /** + * + * + *
+     * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for stockState to set. + * @return This builder for chaining. + */ + public Builder setStockStateValue(int value) { + stockState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stockState. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + getStockState() { + @SuppressWarnings("deprecation") + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState result = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.valueOf( + stockState_); + return result == null + ? com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The stockState to set. + * @return This builder for chaining. + */ + public Builder setStockState( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState value) { + if (value == null) { + throw new NullPointerException(); + } + + stockState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearStockState() { + + stockState_ = 0; + onChanged(); + return this; + } + + private long availableQuantity_; + /** + * + * + *
+     * Optional. The available quantity of the item.
+     * 
+ * + * int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The availableQuantity. + */ + public long getAvailableQuantity() { + return availableQuantity_; + } + /** + * + * + *
+     * Optional. The available quantity of the item.
+     * 
+ * + * int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The availableQuantity to set. + * @return This builder for chaining. + */ + public Builder setAvailableQuantity(long value) { + + availableQuantity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The available quantity of the item.
+     * 
+ * + * int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAvailableQuantity() { + + availableQuantity_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object canonicalProductUri_ = ""; + /** + * + * + *
+     * Optional. Canonical URL directly linking to the item detail page with a
+     * length limit of 5 KiB..
+     * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The canonicalProductUri. + */ + public java.lang.String getCanonicalProductUri() { + java.lang.Object ref = canonicalProductUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalProductUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Canonical URL directly linking to the item detail page with a
+     * length limit of 5 KiB..
+     * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for canonicalProductUri. + */ + public com.google.protobuf.ByteString getCanonicalProductUriBytes() { + java.lang.Object ref = canonicalProductUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalProductUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Canonical URL directly linking to the item detail page with a
+     * length limit of 5 KiB..
+     * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The canonicalProductUri to set. + * @return This builder for chaining. + */ + public Builder setCanonicalProductUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + canonicalProductUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Canonical URL directly linking to the item detail page with a
+     * length limit of 5 KiB..
+     * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCanonicalProductUri() { + + canonicalProductUri_ = getDefaultInstance().getCanonicalProductUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Canonical URL directly linking to the item detail page with a
+     * length limit of 5 KiB..
+     * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for canonicalProductUri to set. + * @return This builder for chaining. + */ + public Builder setCanonicalProductUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + canonicalProductUri_ = value; + onChanged(); + return this; + } + + private java.util.List images_ = + java.util.Collections.emptyList(); + + private void ensureImagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + images_ = + new java.util.ArrayList(images_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.Image, + com.google.cloud.recommendationengine.v1beta1.Image.Builder, + com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder> + imagesBuilder_; + + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getImagesList() { + if (imagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(images_); + } else { + return imagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getImagesCount() { + if (imagesBuilder_ == null) { + return images_.size(); + } else { + return imagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.Image getImages(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setImages(int index, com.google.cloud.recommendationengine.v1beta1.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.set(index, value); + onChanged(); + } else { + imagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setImages( + int index, com.google.cloud.recommendationengine.v1beta1.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.set(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addImages(com.google.cloud.recommendationengine.v1beta1.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(value); + onChanged(); + } else { + imagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addImages(int index, com.google.cloud.recommendationengine.v1beta1.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(index, value); + onChanged(); + } else { + imagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addImages( + com.google.cloud.recommendationengine.v1beta1.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addImages( + int index, com.google.cloud.recommendationengine.v1beta1.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllImages( + java.lang.Iterable values) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, images_); + onChanged(); + } else { + imagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearImages() { + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + imagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeImages(int index) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.remove(index); + onChanged(); + } else { + imagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.Image.Builder getImagesBuilder(int index) { + return getImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder getImagesOrBuilder( + int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getImagesOrBuilderList() { + if (imagesBuilder_ != null) { + return imagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(images_); + } + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.Image.Builder addImagesBuilder() { + return getImagesFieldBuilder() + .addBuilder(com.google.cloud.recommendationengine.v1beta1.Image.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.Image.Builder addImagesBuilder(int index) { + return getImagesFieldBuilder() + .addBuilder( + index, com.google.cloud.recommendationengine.v1beta1.Image.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Product images for the catalog item.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getImagesBuilderList() { + return getImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.Image, + com.google.cloud.recommendationengine.v1beta1.Image.Builder, + com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder> + getImagesFieldBuilder() { + if (imagesBuilder_ == null) { + imagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.Image, + com.google.cloud.recommendationengine.v1beta1.Image.Builder, + com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder>( + images_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + images_ = null; + } + return imagesBuilder_; + } + + @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.recommendationengine.v1beta1.ProductCatalogItem) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + private static final com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductCatalogItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductCatalogItem(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.recommendationengine.v1beta1.ProductCatalogItem + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductCatalogItemOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductCatalogItemOrBuilder.java new file mode 100644 index 00000000..6d9fa853 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductCatalogItemOrBuilder.java @@ -0,0 +1,348 @@ +/* + * 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/recommendationengine/v1beta1/catalog.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ProductCatalogItemOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ProductCatalogItem) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The exact product price.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the exactPrice field is set. + */ + boolean hasExactPrice(); + /** + * + * + *
+   * Optional. The exact product price.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The exactPrice. + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice getExactPrice(); + /** + * + * + *
+   * Optional. The exact product price.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceOrBuilder + getExactPriceOrBuilder(); + + /** + * + * + *
+   * Optional. The product price range.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the priceRange field is set. + */ + boolean hasPriceRange(); + /** + * + * + *
+   * Optional. The product price range.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The priceRange. + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange getPriceRange(); + /** + * + * + *
+   * Optional. The product price range.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeOrBuilder + getPriceRangeOrBuilder(); + + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getCostsCount(); + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsCosts(java.lang.String key); + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getCosts(); + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getCostsMap(); + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + float getCostsOrDefault(java.lang.String key, float defaultValue); + /** + * + * + *
+   * Optional. A map to pass the costs associated with the product.
+   * For example:
+   * {"manufacturing": 45.5} The profit of selling this item is computed like
+   * so:
+   * * If 'exactPrice' is provided, profit = displayPrice - sum(costs)
+   * * If 'priceRange' is provided, profit = minPrice - sum(costs)
+   * 
+ * + * map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + float getCostsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Only required if the price is set. Currency code for price/costs. Use
+   * three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * Optional. Only required if the price is set. Currency code for price/costs. Use
+   * three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); + + /** + * + * + *
+   * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for stockState. + */ + int getStockStateValue(); + /** + * + * + *
+   * Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stockState. + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState getStockState(); + + /** + * + * + *
+   * Optional. The available quantity of the item.
+   * 
+ * + * int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The availableQuantity. + */ + long getAvailableQuantity(); + + /** + * + * + *
+   * Optional. Canonical URL directly linking to the item detail page with a
+   * length limit of 5 KiB..
+   * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The canonicalProductUri. + */ + java.lang.String getCanonicalProductUri(); + /** + * + * + *
+   * Optional. Canonical URL directly linking to the item detail page with a
+   * length limit of 5 KiB..
+   * 
+ * + * string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for canonicalProductUri. + */ + com.google.protobuf.ByteString getCanonicalProductUriBytes(); + + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getImagesList(); + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.Image getImages(int index); + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getImagesCount(); + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getImagesOrBuilderList(); + /** + * + * + *
+   * Optional. Product images for the catalog item.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder getImagesOrBuilder(int index); + + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceCase getPriceCase(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductDetail.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductDetail.java new file mode 100644 index 00000000..41c448c7 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductDetail.java @@ -0,0 +1,1710 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Detailed product information associated with a user event.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductDetail} + */ +public final class ProductDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ProductDetail) + ProductDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductDetail.newBuilder() to construct. + private ProductDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductDetail() { + id_ = ""; + currencyCode_ = ""; + stockState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductDetail( + 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(); + + id_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + currencyCode_ = s; + break; + } + case 29: + { + originalPrice_ = input.readFloat(); + break; + } + case 37: + { + displayPrice_ = input.readFloat(); + break; + } + case 40: + { + int rawValue = input.readEnum(); + + stockState_ = rawValue; + break; + } + case 48: + { + quantity_ = input.readInt32(); + break; + } + case 56: + { + availableQuantity_ = input.readInt32(); + break; + } + case 66: + { + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder subBuilder = null; + if (itemAttributes_ != null) { + subBuilder = itemAttributes_.toBuilder(); + } + itemAttributes_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(itemAttributes_); + itemAttributes_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductDetail.class, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+   * characters.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+   * characters.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * Optional. Currency code for price/costs. Use three-character ISO-4217
+   * code. Required only if originalPrice or displayPrice is set.
+   * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Currency code for price/costs. Use three-character ISO-4217
+   * code. Required only if originalPrice or displayPrice is set.
+   * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 3; + private float originalPrice_; + /** + * + * + *
+   * Optional. Original price of the product. If provided, this will override
+   * the original price in Catalog for this product.
+   * 
+ * + * float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The originalPrice. + */ + public float getOriginalPrice() { + return originalPrice_; + } + + public static final int DISPLAY_PRICE_FIELD_NUMBER = 4; + private float displayPrice_; + /** + * + * + *
+   * Optional. Display price of the product (e.g. discounted price). If
+   * provided, this will override the display price in Catalog for this product.
+   * 
+ * + * float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayPrice. + */ + public float getDisplayPrice() { + return displayPrice_; + } + + public static final int STOCK_STATE_FIELD_NUMBER = 5; + private int stockState_; + /** + * + * + *
+   * Optional. Item stock state. If provided, this overrides the stock state
+   * in Catalog for items in this event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for stockState. + */ + public int getStockStateValue() { + return stockState_; + } + /** + * + * + *
+   * Optional. Item stock state. If provided, this overrides the stock state
+   * in Catalog for items in this event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stockState. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + getStockState() { + @SuppressWarnings("deprecation") + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState result = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.valueOf( + stockState_); + return result == null + ? com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.UNRECOGNIZED + : result; + } + + public static final int QUANTITY_FIELD_NUMBER = 6; + private int quantity_; + /** + * + * + *
+   * Optional. Quantity of the product associated with the user event. For
+   * example, this field will be 2 if two products are added to the shopping
+   * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
+   * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
+   * types.
+   * 
+ * + * int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quantity. + */ + public int getQuantity() { + return quantity_; + } + + public static final int AVAILABLE_QUANTITY_FIELD_NUMBER = 7; + private int availableQuantity_; + /** + * + * + *
+   * Optional. Quantity of the products in stock when a user event happens.
+   * Optional. If provided, this overrides the available quantity in Catalog for
+   * this event. and can only be set if `stock_status` is set to `IN_STOCK`.
+   * Note that if an item is out of stock, you must set the `stock_state` field
+   * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
+   * sufficient to mark the item out of stock.
+   * 
+ * + * int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The availableQuantity. + */ + public int getAvailableQuantity() { + return availableQuantity_; + } + + public static final int ITEM_ATTRIBUTES_FIELD_NUMBER = 8; + private com.google.cloud.recommendationengine.v1beta1.FeatureMap itemAttributes_; + /** + * + * + *
+   * Optional. Extra features associated with a product in the user event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the itemAttributes field is set. + */ + public boolean hasItemAttributes() { + return itemAttributes_ != null; + } + /** + * + * + *
+   * Optional. Extra features associated with a product in the user event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The itemAttributes. + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getItemAttributes() { + return itemAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : itemAttributes_; + } + /** + * + * + *
+   * Optional. Extra features associated with a product in the user event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder + getItemAttributesOrBuilder() { + return getItemAttributes(); + } + + 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getCurrencyCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, currencyCode_); + } + if (originalPrice_ != 0F) { + output.writeFloat(3, originalPrice_); + } + if (displayPrice_ != 0F) { + output.writeFloat(4, displayPrice_); + } + if (stockState_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + .STOCK_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, stockState_); + } + if (quantity_ != 0) { + output.writeInt32(6, quantity_); + } + if (availableQuantity_ != 0) { + output.writeInt32(7, availableQuantity_); + } + if (itemAttributes_ != null) { + output.writeMessage(8, getItemAttributes()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getCurrencyCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, currencyCode_); + } + if (originalPrice_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, originalPrice_); + } + if (displayPrice_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, displayPrice_); + } + if (stockState_ + != com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + .STOCK_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, stockState_); + } + if (quantity_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, quantity_); + } + if (availableQuantity_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, availableQuantity_); + } + if (itemAttributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getItemAttributes()); + } + 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.recommendationengine.v1beta1.ProductDetail)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ProductDetail other = + (com.google.cloud.recommendationengine.v1beta1.ProductDetail) obj; + + if (!getId().equals(other.getId())) return false; + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + if (java.lang.Float.floatToIntBits(getOriginalPrice()) + != java.lang.Float.floatToIntBits(other.getOriginalPrice())) return false; + if (java.lang.Float.floatToIntBits(getDisplayPrice()) + != java.lang.Float.floatToIntBits(other.getDisplayPrice())) return false; + if (stockState_ != other.stockState_) return false; + if (getQuantity() != other.getQuantity()) return false; + if (getAvailableQuantity() != other.getAvailableQuantity()) return false; + if (hasItemAttributes() != other.hasItemAttributes()) return false; + if (hasItemAttributes()) { + if (!getItemAttributes().equals(other.getItemAttributes())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalPrice()); + hash = (37 * hash) + DISPLAY_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getDisplayPrice()); + hash = (37 * hash) + STOCK_STATE_FIELD_NUMBER; + hash = (53 * hash) + stockState_; + hash = (37 * hash) + QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getQuantity(); + hash = (37 * hash) + AVAILABLE_QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableQuantity(); + if (hasItemAttributes()) { + hash = (37 * hash) + ITEM_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getItemAttributes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail 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.recommendationengine.v1beta1.ProductDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail 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.recommendationengine.v1beta1.ProductDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail 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.recommendationengine.v1beta1.ProductDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail 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.recommendationengine.v1beta1.ProductDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail 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.recommendationengine.v1beta1.ProductDetail 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; + } + /** + * + * + *
+   * Detailed product information associated with a user event.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ProductDetail) + com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductDetail.class, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.ProductDetail.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(); + id_ = ""; + + currencyCode_ = ""; + + originalPrice_ = 0F; + + displayPrice_ = 0F; + + stockState_ = 0; + + quantity_ = 0; + + availableQuantity_ = 0; + + if (itemAttributesBuilder_ == null) { + itemAttributes_ = null; + } else { + itemAttributes_ = null; + itemAttributesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductDetail getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ProductDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductDetail build() { + com.google.cloud.recommendationengine.v1beta1.ProductDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductDetail buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ProductDetail result = + new com.google.cloud.recommendationengine.v1beta1.ProductDetail(this); + result.id_ = id_; + result.currencyCode_ = currencyCode_; + result.originalPrice_ = originalPrice_; + result.displayPrice_ = displayPrice_; + result.stockState_ = stockState_; + result.quantity_ = quantity_; + result.availableQuantity_ = availableQuantity_; + if (itemAttributesBuilder_ == null) { + result.itemAttributes_ = itemAttributes_; + } else { + result.itemAttributes_ = itemAttributesBuilder_.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.recommendationengine.v1beta1.ProductDetail) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.ProductDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.ProductDetail other) { + if (other == com.google.cloud.recommendationengine.v1beta1.ProductDetail.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + onChanged(); + } + if (other.getOriginalPrice() != 0F) { + setOriginalPrice(other.getOriginalPrice()); + } + if (other.getDisplayPrice() != 0F) { + setDisplayPrice(other.getDisplayPrice()); + } + if (other.stockState_ != 0) { + setStockStateValue(other.getStockStateValue()); + } + if (other.getQuantity() != 0) { + setQuantity(other.getQuantity()); + } + if (other.getAvailableQuantity() != 0) { + setAvailableQuantity(other.getAvailableQuantity()); + } + if (other.hasItemAttributes()) { + mergeItemAttributes(other.getItemAttributes()); + } + 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.recommendationengine.v1beta1.ProductDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ProductDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+     * characters.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+     * characters.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+     * characters.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+     * characters.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+     * characters.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * Optional. Currency code for price/costs. Use three-character ISO-4217
+     * code. Required only if originalPrice or displayPrice is set.
+     * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Currency code for price/costs. Use three-character ISO-4217
+     * code. Required only if originalPrice or displayPrice is set.
+     * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Currency code for price/costs. Use three-character ISO-4217
+     * code. Required only if originalPrice or displayPrice is set.
+     * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Currency code for price/costs. Use three-character ISO-4217
+     * code. Required only if originalPrice or displayPrice is set.
+     * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Currency code for price/costs. Use three-character ISO-4217
+     * code. Required only if originalPrice or displayPrice is set.
+     * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = value; + onChanged(); + return this; + } + + private float originalPrice_; + /** + * + * + *
+     * Optional. Original price of the product. If provided, this will override
+     * the original price in Catalog for this product.
+     * 
+ * + * float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The originalPrice. + */ + public float getOriginalPrice() { + return originalPrice_; + } + /** + * + * + *
+     * Optional. Original price of the product. If provided, this will override
+     * the original price in Catalog for this product.
+     * 
+ * + * float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The originalPrice to set. + * @return This builder for chaining. + */ + public Builder setOriginalPrice(float value) { + + originalPrice_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Original price of the product. If provided, this will override
+     * the original price in Catalog for this product.
+     * 
+ * + * float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOriginalPrice() { + + originalPrice_ = 0F; + onChanged(); + return this; + } + + private float displayPrice_; + /** + * + * + *
+     * Optional. Display price of the product (e.g. discounted price). If
+     * provided, this will override the display price in Catalog for this product.
+     * 
+ * + * float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayPrice. + */ + public float getDisplayPrice() { + return displayPrice_; + } + /** + * + * + *
+     * Optional. Display price of the product (e.g. discounted price). If
+     * provided, this will override the display price in Catalog for this product.
+     * 
+ * + * float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayPrice to set. + * @return This builder for chaining. + */ + public Builder setDisplayPrice(float value) { + + displayPrice_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Display price of the product (e.g. discounted price). If
+     * provided, this will override the display price in Catalog for this product.
+     * 
+ * + * float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayPrice() { + + displayPrice_ = 0F; + onChanged(); + return this; + } + + private int stockState_ = 0; + /** + * + * + *
+     * Optional. Item stock state. If provided, this overrides the stock state
+     * in Catalog for items in this event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for stockState. + */ + public int getStockStateValue() { + return stockState_; + } + /** + * + * + *
+     * Optional. Item stock state. If provided, this overrides the stock state
+     * in Catalog for items in this event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for stockState to set. + * @return This builder for chaining. + */ + public Builder setStockStateValue(int value) { + stockState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Item stock state. If provided, this overrides the stock state
+     * in Catalog for items in this event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stockState. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + getStockState() { + @SuppressWarnings("deprecation") + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState result = + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.valueOf( + stockState_); + return result == null + ? com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Item stock state. If provided, this overrides the stock state
+     * in Catalog for items in this event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The stockState to set. + * @return This builder for chaining. + */ + public Builder setStockState( + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState value) { + if (value == null) { + throw new NullPointerException(); + } + + stockState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Item stock state. If provided, this overrides the stock state
+     * in Catalog for items in this event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearStockState() { + + stockState_ = 0; + onChanged(); + return this; + } + + private int quantity_; + /** + * + * + *
+     * Optional. Quantity of the product associated with the user event. For
+     * example, this field will be 2 if two products are added to the shopping
+     * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
+     * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
+     * types.
+     * 
+ * + * int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quantity. + */ + public int getQuantity() { + return quantity_; + } + /** + * + * + *
+     * Optional. Quantity of the product associated with the user event. For
+     * example, this field will be 2 if two products are added to the shopping
+     * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
+     * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
+     * types.
+     * 
+ * + * int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The quantity to set. + * @return This builder for chaining. + */ + public Builder setQuantity(int value) { + + quantity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Quantity of the product associated with the user event. For
+     * example, this field will be 2 if two products are added to the shopping
+     * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
+     * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
+     * types.
+     * 
+ * + * int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearQuantity() { + + quantity_ = 0; + onChanged(); + return this; + } + + private int availableQuantity_; + /** + * + * + *
+     * Optional. Quantity of the products in stock when a user event happens.
+     * Optional. If provided, this overrides the available quantity in Catalog for
+     * this event. and can only be set if `stock_status` is set to `IN_STOCK`.
+     * Note that if an item is out of stock, you must set the `stock_state` field
+     * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
+     * sufficient to mark the item out of stock.
+     * 
+ * + * int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The availableQuantity. + */ + public int getAvailableQuantity() { + return availableQuantity_; + } + /** + * + * + *
+     * Optional. Quantity of the products in stock when a user event happens.
+     * Optional. If provided, this overrides the available quantity in Catalog for
+     * this event. and can only be set if `stock_status` is set to `IN_STOCK`.
+     * Note that if an item is out of stock, you must set the `stock_state` field
+     * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
+     * sufficient to mark the item out of stock.
+     * 
+ * + * int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The availableQuantity to set. + * @return This builder for chaining. + */ + public Builder setAvailableQuantity(int value) { + + availableQuantity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Quantity of the products in stock when a user event happens.
+     * Optional. If provided, this overrides the available quantity in Catalog for
+     * this event. and can only be set if `stock_status` is set to `IN_STOCK`.
+     * Note that if an item is out of stock, you must set the `stock_state` field
+     * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
+     * sufficient to mark the item out of stock.
+     * 
+ * + * int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAvailableQuantity() { + + availableQuantity_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.FeatureMap itemAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder> + itemAttributesBuilder_; + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the itemAttributes field is set. + */ + public boolean hasItemAttributes() { + return itemAttributesBuilder_ != null || itemAttributes_ != null; + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The itemAttributes. + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap getItemAttributes() { + if (itemAttributesBuilder_ == null) { + return itemAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : itemAttributes_; + } else { + return itemAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setItemAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap value) { + if (itemAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + itemAttributes_ = value; + onChanged(); + } else { + itemAttributesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setItemAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder builderForValue) { + if (itemAttributesBuilder_ == null) { + itemAttributes_ = builderForValue.build(); + onChanged(); + } else { + itemAttributesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeItemAttributes( + com.google.cloud.recommendationengine.v1beta1.FeatureMap value) { + if (itemAttributesBuilder_ == null) { + if (itemAttributes_ != null) { + itemAttributes_ = + com.google.cloud.recommendationengine.v1beta1.FeatureMap.newBuilder(itemAttributes_) + .mergeFrom(value) + .buildPartial(); + } else { + itemAttributes_ = value; + } + onChanged(); + } else { + itemAttributesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearItemAttributes() { + if (itemAttributesBuilder_ == null) { + itemAttributes_ = null; + onChanged(); + } else { + itemAttributes_ = null; + itemAttributesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder + getItemAttributesBuilder() { + + onChanged(); + return getItemAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder + getItemAttributesOrBuilder() { + if (itemAttributesBuilder_ != null) { + return itemAttributesBuilder_.getMessageOrBuilder(); + } else { + return itemAttributes_ == null + ? com.google.cloud.recommendationengine.v1beta1.FeatureMap.getDefaultInstance() + : itemAttributes_; + } + } + /** + * + * + *
+     * Optional. Extra features associated with a product in the user event.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder> + getItemAttributesFieldBuilder() { + if (itemAttributesBuilder_ == null) { + itemAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.FeatureMap, + com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder, + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder>( + getItemAttributes(), getParentForChildren(), isClean()); + itemAttributes_ = null; + } + return itemAttributesBuilder_; + } + + @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.recommendationengine.v1beta1.ProductDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ProductDetail) + private static final com.google.cloud.recommendationengine.v1beta1.ProductDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ProductDetail(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductDetail(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.recommendationengine.v1beta1.ProductDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductDetailOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductDetailOrBuilder.java new file mode 100644 index 00000000..f628f0a2 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductDetailOrBuilder.java @@ -0,0 +1,214 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ProductDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ProductDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+   * characters.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
+   * characters.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Optional. Currency code for price/costs. Use three-character ISO-4217
+   * code. Required only if originalPrice or displayPrice is set.
+   * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * Optional. Currency code for price/costs. Use three-character ISO-4217
+   * code. Required only if originalPrice or displayPrice is set.
+   * 
+ * + * string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); + + /** + * + * + *
+   * Optional. Original price of the product. If provided, this will override
+   * the original price in Catalog for this product.
+   * 
+ * + * float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The originalPrice. + */ + float getOriginalPrice(); + + /** + * + * + *
+   * Optional. Display price of the product (e.g. discounted price). If
+   * provided, this will override the display price in Catalog for this product.
+   * 
+ * + * float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayPrice. + */ + float getDisplayPrice(); + + /** + * + * + *
+   * Optional. Item stock state. If provided, this overrides the stock state
+   * in Catalog for items in this event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for stockState. + */ + int getStockStateValue(); + /** + * + * + *
+   * Optional. Item stock state. If provided, this overrides the stock state
+   * in Catalog for items in this event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stockState. + */ + com.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState getStockState(); + + /** + * + * + *
+   * Optional. Quantity of the product associated with the user event. For
+   * example, this field will be 2 if two products are added to the shopping
+   * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
+   * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
+   * types.
+   * 
+ * + * int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quantity. + */ + int getQuantity(); + + /** + * + * + *
+   * Optional. Quantity of the products in stock when a user event happens.
+   * Optional. If provided, this overrides the available quantity in Catalog for
+   * this event. and can only be set if `stock_status` is set to `IN_STOCK`.
+   * Note that if an item is out of stock, you must set the `stock_state` field
+   * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
+   * sufficient to mark the item out of stock.
+   * 
+ * + * int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The availableQuantity. + */ + int getAvailableQuantity(); + + /** + * + * + *
+   * Optional. Extra features associated with a product in the user event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the itemAttributes field is set. + */ + boolean hasItemAttributes(); + /** + * + * + *
+   * Optional. Extra features associated with a product in the user event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The itemAttributes. + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMap getItemAttributes(); + /** + * + * + *
+   * Optional. Extra features associated with a product in the user event.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.FeatureMapOrBuilder getItemAttributesOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductEventDetail.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductEventDetail.java new file mode 100644 index 00000000..37438cd6 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductEventDetail.java @@ -0,0 +1,2996 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * ProductEventDetail captures user event information specific to retail
+ * products.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductEventDetail} + */ +public final class ProductEventDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ProductEventDetail) + ProductEventDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductEventDetail.newBuilder() to construct. + private ProductEventDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductEventDetail() { + searchQuery_ = ""; + pageCategories_ = java.util.Collections.emptyList(); + productDetails_ = java.util.Collections.emptyList(); + listId_ = ""; + cartId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductEventDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductEventDetail( + 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(); + + searchQuery_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + pageCategories_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .CategoryHierarchy>(); + mutable_bitField0_ |= 0x00000001; + } + pageCategories_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .parser(), + extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + productDetails_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.ProductDetail>(); + mutable_bitField0_ |= 0x00000002; + } + productDetails_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ProductDetail.parser(), + extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + listId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + cartId_ = s; + break; + } + case 50: + { + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder subBuilder = + null; + if (purchaseTransaction_ != null) { + subBuilder = purchaseTransaction_.toBuilder(); + } + purchaseTransaction_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(purchaseTransaction_); + purchaseTransaction_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + pageCategories_ = java.util.Collections.unmodifiableList(pageCategories_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.class, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder.class); + } + + public static final int SEARCH_QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object searchQuery_; + /** + * + * + *
+   * Required for `search` events. Other event types should not set this field.
+   * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+   * 
+ * + * string search_query = 1; + * + * @return The searchQuery. + */ + public java.lang.String getSearchQuery() { + java.lang.Object ref = searchQuery_; + 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(); + searchQuery_ = s; + return s; + } + } + /** + * + * + *
+   * Required for `search` events. Other event types should not set this field.
+   * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+   * 
+ * + * string search_query = 1; + * + * @return The bytes for searchQuery. + */ + public com.google.protobuf.ByteString getSearchQueryBytes() { + java.lang.Object ref = searchQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 2; + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + pageCategories_; + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public java.util.List + getPageCategoriesList() { + return pageCategories_; + } + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + getPageCategoriesOrBuilderList() { + return pageCategories_; + } + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder + getPageCategoriesOrBuilder(int index) { + return pageCategories_.get(index); + } + + public static final int PRODUCT_DETAILS_FIELD_NUMBER = 3; + private java.util.List + productDetails_; + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public java.util.List + getProductDetailsList() { + return productDetails_; + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> + getProductDetailsOrBuilderList() { + return productDetails_; + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public int getProductDetailsCount() { + return productDetails_.size(); + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetail getProductDetails(int index) { + return productDetails_.get(index); + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder + getProductDetailsOrBuilder(int index) { + return productDetails_.get(index); + } + + public static final int LIST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object listId_; + /** + * + * + *
+   * Required for `add-to-list` and `remove-from-list` events. The id or name of
+   * the list that the item is being added to or removed from. Other event types
+   * should not set this field.
+   * 
+ * + * string list_id = 4; + * + * @return The listId. + */ + public java.lang.String getListId() { + java.lang.Object ref = listId_; + 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(); + listId_ = s; + return s; + } + } + /** + * + * + *
+   * Required for `add-to-list` and `remove-from-list` events. The id or name of
+   * the list that the item is being added to or removed from. Other event types
+   * should not set this field.
+   * 
+ * + * string list_id = 4; + * + * @return The bytes for listId. + */ + public com.google.protobuf.ByteString getListIdBytes() { + java.lang.Object ref = listId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + listId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CART_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object cartId_; + /** + * + * + *
+   * Optional. The id or name of the associated shopping cart. This id is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `remove-from-cart`,
+   * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The cartId. + */ + public java.lang.String getCartId() { + java.lang.Object ref = cartId_; + 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(); + cartId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The id or name of the associated shopping cart. This id is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `remove-from-cart`,
+   * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for cartId. + */ + public com.google.protobuf.ByteString getCartIdBytes() { + java.lang.Object ref = cartId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cartId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PURCHASE_TRANSACTION_FIELD_NUMBER = 6; + private com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchaseTransaction_; + /** + * + * + *
+   * Optional. A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Optional for `checkout-start`
+   * events. Other event types should not set this field.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the purchaseTransaction field is set. + */ + public boolean hasPurchaseTransaction() { + return purchaseTransaction_ != null; + } + /** + * + * + *
+   * Optional. A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Optional for `checkout-start`
+   * events. Other event types should not set this field.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The purchaseTransaction. + */ + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction + getPurchaseTransaction() { + return purchaseTransaction_ == null + ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } + /** + * + * + *
+   * Optional. A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Optional for `checkout-start`
+   * events. Other event types should not set this field.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder() { + return getPurchaseTransaction(); + } + + 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 (!getSearchQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, searchQuery_); + } + for (int i = 0; i < pageCategories_.size(); i++) { + output.writeMessage(2, pageCategories_.get(i)); + } + for (int i = 0; i < productDetails_.size(); i++) { + output.writeMessage(3, productDetails_.get(i)); + } + if (!getListIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, listId_); + } + if (!getCartIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, cartId_); + } + if (purchaseTransaction_ != null) { + output.writeMessage(6, getPurchaseTransaction()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSearchQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, searchQuery_); + } + for (int i = 0; i < pageCategories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, pageCategories_.get(i)); + } + for (int i = 0; i < productDetails_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, productDetails_.get(i)); + } + if (!getListIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, listId_); + } + if (!getCartIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, cartId_); + } + if (purchaseTransaction_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPurchaseTransaction()); + } + 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.recommendationengine.v1beta1.ProductEventDetail)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail other = + (com.google.cloud.recommendationengine.v1beta1.ProductEventDetail) obj; + + if (!getSearchQuery().equals(other.getSearchQuery())) return false; + if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; + if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; + if (!getListId().equals(other.getListId())) return false; + if (!getCartId().equals(other.getCartId())) return false; + if (hasPurchaseTransaction() != other.hasPurchaseTransaction()) return false; + if (hasPurchaseTransaction()) { + if (!getPurchaseTransaction().equals(other.getPurchaseTransaction())) 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) + SEARCH_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getSearchQuery().hashCode(); + if (getPageCategoriesCount() > 0) { + hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getPageCategoriesList().hashCode(); + } + if (getProductDetailsCount() > 0) { + hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getProductDetailsList().hashCode(); + } + hash = (37 * hash) + LIST_ID_FIELD_NUMBER; + hash = (53 * hash) + getListId().hashCode(); + hash = (37 * hash) + CART_ID_FIELD_NUMBER; + hash = (53 * hash) + getCartId().hashCode(); + if (hasPurchaseTransaction()) { + hash = (37 * hash) + PURCHASE_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getPurchaseTransaction().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail 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.recommendationengine.v1beta1.ProductEventDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail 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.recommendationengine.v1beta1.ProductEventDetail parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail 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.recommendationengine.v1beta1.ProductEventDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail 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.recommendationengine.v1beta1.ProductEventDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail 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.recommendationengine.v1beta1.ProductEventDetail 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; + } + /** + * + * + *
+   * ProductEventDetail captures user event information specific to retail
+   * products.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductEventDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ProductEventDetail) + com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.class, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPageCategoriesFieldBuilder(); + getProductDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + searchQuery_ = ""; + + if (pageCategoriesBuilder_ == null) { + pageCategories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + pageCategoriesBuilder_.clear(); + } + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + productDetailsBuilder_.clear(); + } + listId_ = ""; + + cartId_ = ""; + + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = null; + } else { + purchaseTransaction_ = null; + purchaseTransactionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail build() { + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail buildPartial() { + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail result = + new com.google.cloud.recommendationengine.v1beta1.ProductEventDetail(this); + int from_bitField0_ = bitField0_; + result.searchQuery_ = searchQuery_; + if (pageCategoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + pageCategories_ = java.util.Collections.unmodifiableList(pageCategories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.pageCategories_ = pageCategories_; + } else { + result.pageCategories_ = pageCategoriesBuilder_.build(); + } + if (productDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.productDetails_ = productDetails_; + } else { + result.productDetails_ = productDetailsBuilder_.build(); + } + result.listId_ = listId_; + result.cartId_ = cartId_; + if (purchaseTransactionBuilder_ == null) { + result.purchaseTransaction_ = purchaseTransaction_; + } else { + result.purchaseTransaction_ = purchaseTransactionBuilder_.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.recommendationengine.v1beta1.ProductEventDetail) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.ProductEventDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance()) + return this; + if (!other.getSearchQuery().isEmpty()) { + searchQuery_ = other.searchQuery_; + onChanged(); + } + if (pageCategoriesBuilder_ == null) { + if (!other.pageCategories_.isEmpty()) { + if (pageCategories_.isEmpty()) { + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePageCategoriesIsMutable(); + pageCategories_.addAll(other.pageCategories_); + } + onChanged(); + } + } else { + if (!other.pageCategories_.isEmpty()) { + if (pageCategoriesBuilder_.isEmpty()) { + pageCategoriesBuilder_.dispose(); + pageCategoriesBuilder_ = null; + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000001); + pageCategoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPageCategoriesFieldBuilder() + : null; + } else { + pageCategoriesBuilder_.addAllMessages(other.pageCategories_); + } + } + } + if (productDetailsBuilder_ == null) { + if (!other.productDetails_.isEmpty()) { + if (productDetails_.isEmpty()) { + productDetails_ = other.productDetails_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureProductDetailsIsMutable(); + productDetails_.addAll(other.productDetails_); + } + onChanged(); + } + } else { + if (!other.productDetails_.isEmpty()) { + if (productDetailsBuilder_.isEmpty()) { + productDetailsBuilder_.dispose(); + productDetailsBuilder_ = null; + productDetails_ = other.productDetails_; + bitField0_ = (bitField0_ & ~0x00000002); + productDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductDetailsFieldBuilder() + : null; + } else { + productDetailsBuilder_.addAllMessages(other.productDetails_); + } + } + } + if (!other.getListId().isEmpty()) { + listId_ = other.listId_; + onChanged(); + } + if (!other.getCartId().isEmpty()) { + cartId_ = other.cartId_; + onChanged(); + } + if (other.hasPurchaseTransaction()) { + mergePurchaseTransaction(other.getPurchaseTransaction()); + } + 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.recommendationengine.v1beta1.ProductEventDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.ProductEventDetail) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object searchQuery_ = ""; + /** + * + * + *
+     * Required for `search` events. Other event types should not set this field.
+     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+     * 
+ * + * string search_query = 1; + * + * @return The searchQuery. + */ + public java.lang.String getSearchQuery() { + java.lang.Object ref = searchQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + searchQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required for `search` events. Other event types should not set this field.
+     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+     * 
+ * + * string search_query = 1; + * + * @return The bytes for searchQuery. + */ + public com.google.protobuf.ByteString getSearchQueryBytes() { + java.lang.Object ref = searchQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required for `search` events. Other event types should not set this field.
+     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+     * 
+ * + * string search_query = 1; + * + * @param value The searchQuery to set. + * @return This builder for chaining. + */ + public Builder setSearchQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + searchQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required for `search` events. Other event types should not set this field.
+     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+     * 
+ * + * string search_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearSearchQuery() { + + searchQuery_ = getDefaultInstance().getSearchQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required for `search` events. Other event types should not set this field.
+     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+     * 
+ * + * string search_query = 1; + * + * @param value The bytes for searchQuery to set. + * @return This builder for chaining. + */ + public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + searchQuery_ = value; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + pageCategories_ = java.util.Collections.emptyList(); + + private void ensurePageCategoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + pageCategories_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy>( + pageCategories_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + pageCategoriesBuilder_; + + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + getPageCategoriesList() { + if (pageCategoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(pageCategories_); + } else { + return pageCategoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public int getPageCategoriesCount() { + if (pageCategoriesBuilder_ == null) { + return pageCategories_.size(); + } else { + return pageCategoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + getPageCategories(int index) { + if (pageCategoriesBuilder_ == null) { + return pageCategories_.get(index); + } else { + return pageCategoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder setPageCategories( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { + if (pageCategoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, value); + onChanged(); + } else { + pageCategoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder setPageCategories( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + builderForValue) { + if (pageCategoriesBuilder_ == null) { + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, builderForValue.build()); + onChanged(); + } else { + pageCategoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder addPageCategories( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { + if (pageCategoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + } else { + pageCategoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder addPageCategories( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { + if (pageCategoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(index, value); + onChanged(); + } else { + pageCategoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder addPageCategories( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + builderForValue) { + if (pageCategoriesBuilder_ == null) { + ensurePageCategoriesIsMutable(); + pageCategories_.add(builderForValue.build()); + onChanged(); + } else { + pageCategoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder addPageCategories( + int index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + builderForValue) { + if (pageCategoriesBuilder_ == null) { + ensurePageCategoriesIsMutable(); + pageCategories_.add(index, builderForValue.build()); + onChanged(); + } else { + pageCategoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder addAllPageCategories( + java.lang.Iterable< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> + values) { + if (pageCategoriesBuilder_ == null) { + ensurePageCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); + onChanged(); + } else { + pageCategoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder clearPageCategories() { + if (pageCategoriesBuilder_ == null) { + pageCategories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + pageCategoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public Builder removePageCategories(int index) { + if (pageCategoriesBuilder_ == null) { + ensurePageCategoriesIsMutable(); + pageCategories_.remove(index); + onChanged(); + } else { + pageCategoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + getPageCategoriesBuilder(int index) { + return getPageCategoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder + getPageCategoriesOrBuilder(int index) { + if (pageCategoriesBuilder_ == null) { + return pageCategories_.get(index); + } else { + return pageCategoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .CategoryHierarchyOrBuilder> + getPageCategoriesOrBuilderList() { + if (pageCategoriesBuilder_ != null) { + return pageCategoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pageCategories_); + } + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + addPageCategoriesBuilder() { + return getPageCategoriesFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .getDefaultInstance()); + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder + addPageCategoriesBuilder(int index) { + return getPageCategoriesFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + .getDefaultInstance()); + } + /** + * + * + *
+     * Required for `category-page-view` events. Other event types should not set
+     * this field.
+     * The categories associated with a category page.
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * categories : ["Sales", "2017 Black Friday Deals"].
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + public java.util.List< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder> + getPageCategoriesBuilderList() { + return getPageCategoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + getPageCategoriesFieldBuilder() { + if (pageCategoriesBuilder_ == null) { + pageCategoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItem + .CategoryHierarchyOrBuilder>( + pageCategories_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + pageCategories_ = null; + } + return pageCategoriesBuilder_; + } + + private java.util.List + productDetails_ = java.util.Collections.emptyList(); + + private void ensureProductDetailsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + productDetails_ = + new java.util.ArrayList( + productDetails_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductDetail, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> + productDetailsBuilder_; + + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public java.util.List + getProductDetailsList() { + if (productDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productDetails_); + } else { + return productDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public int getProductDetailsCount() { + if (productDetailsBuilder_ == null) { + return productDetails_.size(); + } else { + return productDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetail getProductDetails( + int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder setProductDetails( + int index, com.google.cloud.recommendationengine.v1beta1.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.set(index, value); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder setProductDetails( + int index, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder addProductDetails( + com.google.cloud.recommendationengine.v1beta1.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder addProductDetails( + int index, com.google.cloud.recommendationengine.v1beta1.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(index, value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder addProductDetails( + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder addProductDetails( + int index, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder addAllProductDetails( + java.lang.Iterable + values) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productDetails_); + onChanged(); + } else { + productDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder clearProductDetails() { + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + productDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public Builder removeProductDetails(int index) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.remove(index); + onChanged(); + } else { + productDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder + getProductDetailsBuilder(int index) { + return getProductDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder + getProductDetailsOrBuilder(int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> + getProductDetailsOrBuilderList() { + if (productDetailsBuilder_ != null) { + return productDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productDetails_); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder + addProductDetailsBuilder() { + return getProductDetailsFieldBuilder() + .addBuilder( + com.google.cloud.recommendationengine.v1beta1.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder + addProductDetailsBuilder(int index) { + return getProductDetailsFieldBuilder() + .addBuilder( + index, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_details' should be set for
+     *   this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `category-page-view`
+     * * `home-page-view`
+     * * `search`
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + public java.util.List + getProductDetailsBuilderList() { + return getProductDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductDetail, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> + getProductDetailsFieldBuilder() { + if (productDetailsBuilder_ == null) { + productDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductDetail, + com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder>( + productDetails_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + productDetails_ = null; + } + return productDetailsBuilder_; + } + + private java.lang.Object listId_ = ""; + /** + * + * + *
+     * Required for `add-to-list` and `remove-from-list` events. The id or name of
+     * the list that the item is being added to or removed from. Other event types
+     * should not set this field.
+     * 
+ * + * string list_id = 4; + * + * @return The listId. + */ + public java.lang.String getListId() { + java.lang.Object ref = listId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + listId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required for `add-to-list` and `remove-from-list` events. The id or name of
+     * the list that the item is being added to or removed from. Other event types
+     * should not set this field.
+     * 
+ * + * string list_id = 4; + * + * @return The bytes for listId. + */ + public com.google.protobuf.ByteString getListIdBytes() { + java.lang.Object ref = listId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + listId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required for `add-to-list` and `remove-from-list` events. The id or name of
+     * the list that the item is being added to or removed from. Other event types
+     * should not set this field.
+     * 
+ * + * string list_id = 4; + * + * @param value The listId to set. + * @return This builder for chaining. + */ + public Builder setListId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + listId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required for `add-to-list` and `remove-from-list` events. The id or name of
+     * the list that the item is being added to or removed from. Other event types
+     * should not set this field.
+     * 
+ * + * string list_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearListId() { + + listId_ = getDefaultInstance().getListId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required for `add-to-list` and `remove-from-list` events. The id or name of
+     * the list that the item is being added to or removed from. Other event types
+     * should not set this field.
+     * 
+ * + * string list_id = 4; + * + * @param value The bytes for listId to set. + * @return This builder for chaining. + */ + public Builder setListIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + listId_ = value; + onChanged(); + return this; + } + + private java.lang.Object cartId_ = ""; + /** + * + * + *
+     * Optional. The id or name of the associated shopping cart. This id is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `remove-from-cart`,
+     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The cartId. + */ + public java.lang.String getCartId() { + java.lang.Object ref = cartId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cartId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The id or name of the associated shopping cart. This id is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `remove-from-cart`,
+     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for cartId. + */ + public com.google.protobuf.ByteString getCartIdBytes() { + java.lang.Object ref = cartId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cartId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The id or name of the associated shopping cart. This id is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `remove-from-cart`,
+     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The cartId to set. + * @return This builder for chaining. + */ + public Builder setCartId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cartId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The id or name of the associated shopping cart. This id is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `remove-from-cart`,
+     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCartId() { + + cartId_ = getDefaultInstance().getCartId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The id or name of the associated shopping cart. This id is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `remove-from-cart`,
+     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for cartId to set. + * @return This builder for chaining. + */ + public Builder setCartIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cartId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchaseTransaction_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder> + purchaseTransactionBuilder_; + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the purchaseTransaction field is set. + */ + public boolean hasPurchaseTransaction() { + return purchaseTransactionBuilder_ != null || purchaseTransaction_ != null; + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The purchaseTransaction. + */ + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction + getPurchaseTransaction() { + if (purchaseTransactionBuilder_ == null) { + return purchaseTransaction_ == null + ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } else { + return purchaseTransactionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPurchaseTransaction( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction value) { + if (purchaseTransactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + purchaseTransaction_ = value; + onChanged(); + } else { + purchaseTransactionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPurchaseTransaction( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder builderForValue) { + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = builderForValue.build(); + onChanged(); + } else { + purchaseTransactionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePurchaseTransaction( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction value) { + if (purchaseTransactionBuilder_ == null) { + if (purchaseTransaction_ != null) { + purchaseTransaction_ = + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.newBuilder( + purchaseTransaction_) + .mergeFrom(value) + .buildPartial(); + } else { + purchaseTransaction_ = value; + } + onChanged(); + } else { + purchaseTransactionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPurchaseTransaction() { + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = null; + onChanged(); + } else { + purchaseTransaction_ = null; + purchaseTransactionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder + getPurchaseTransactionBuilder() { + + onChanged(); + return getPurchaseTransactionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder() { + if (purchaseTransactionBuilder_ != null) { + return purchaseTransactionBuilder_.getMessageOrBuilder(); + } else { + return purchaseTransaction_ == null + ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } + } + /** + * + * + *
+     * Optional. A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Optional for `checkout-start`
+     * events. Other event types should not set this field.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder> + getPurchaseTransactionFieldBuilder() { + if (purchaseTransactionBuilder_ == null) { + purchaseTransactionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder>( + getPurchaseTransaction(), getParentForChildren(), isClean()); + purchaseTransaction_ = null; + } + return purchaseTransactionBuilder_; + } + + @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.recommendationengine.v1beta1.ProductEventDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ProductEventDetail) + private static final com.google.cloud.recommendationengine.v1beta1.ProductEventDetail + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ProductEventDetail(); + } + + public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductEventDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductEventDetail(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.recommendationengine.v1beta1.ProductEventDetail + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductEventDetailOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductEventDetailOrBuilder.java new file mode 100644 index 00000000..c4a54864 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/ProductEventDetailOrBuilder.java @@ -0,0 +1,396 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface ProductEventDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.ProductEventDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required for `search` events. Other event types should not set this field.
+   * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+   * 
+ * + * string search_query = 1; + * + * @return The searchQuery. + */ + java.lang.String getSearchQuery(); + /** + * + * + *
+   * Required for `search` events. Other event types should not set this field.
+   * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
+   * 
+ * + * string search_query = 1; + * + * @return The bytes for searchQuery. + */ + com.google.protobuf.ByteString getSearchQueryBytes(); + + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + java.util.List + getPageCategoriesList(); + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy getPageCategories( + int index); + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + int getPageCategoriesCount(); + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> + getPageCategoriesOrBuilderList(); + /** + * + * + *
+   * Required for `category-page-view` events. Other event types should not set
+   * this field.
+   * The categories associated with a category page.
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * categories : ["Sales", "2017 Black Friday Deals"].
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder + getPageCategoriesOrBuilder(int index); + + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + java.util.List + getProductDetailsList(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + com.google.cloud.recommendationengine.v1beta1.ProductDetail getProductDetails(int index); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + int getProductDetailsCount(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + java.util.List + getProductDetailsOrBuilderList(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_details' should be set for
+   *   this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `category-page-view`
+   * * `home-page-view`
+   * * `search`
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * + */ + com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder getProductDetailsOrBuilder( + int index); + + /** + * + * + *
+   * Required for `add-to-list` and `remove-from-list` events. The id or name of
+   * the list that the item is being added to or removed from. Other event types
+   * should not set this field.
+   * 
+ * + * string list_id = 4; + * + * @return The listId. + */ + java.lang.String getListId(); + /** + * + * + *
+   * Required for `add-to-list` and `remove-from-list` events. The id or name of
+   * the list that the item is being added to or removed from. Other event types
+   * should not set this field.
+   * 
+ * + * string list_id = 4; + * + * @return The bytes for listId. + */ + com.google.protobuf.ByteString getListIdBytes(); + + /** + * + * + *
+   * Optional. The id or name of the associated shopping cart. This id is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `remove-from-cart`,
+   * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The cartId. + */ + java.lang.String getCartId(); + /** + * + * + *
+   * Optional. The id or name of the associated shopping cart. This id is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `remove-from-cart`,
+   * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for cartId. + */ + com.google.protobuf.ByteString getCartIdBytes(); + + /** + * + * + *
+   * Optional. A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Optional for `checkout-start`
+   * events. Other event types should not set this field.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the purchaseTransaction field is set. + */ + boolean hasPurchaseTransaction(); + /** + * + * + *
+   * Optional. A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Optional for `checkout-start`
+   * events. Other event types should not set this field.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The purchaseTransaction. + */ + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction getPurchaseTransaction(); + /** + * + * + *
+   * Optional. A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Optional for `checkout-start`
+   * events. Other event types should not set this field.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurchaseTransaction.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurchaseTransaction.java new file mode 100644 index 00000000..ad30e142 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurchaseTransaction.java @@ -0,0 +1,1610 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * A transaction represents the entire purchase transaction.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurchaseTransaction} + */ +public final class PurchaseTransaction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PurchaseTransaction) + PurchaseTransactionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurchaseTransaction.newBuilder() to construct. + private PurchaseTransaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurchaseTransaction() { + id_ = ""; + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurchaseTransaction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurchaseTransaction( + 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(); + + id_ = s; + break; + } + case 21: + { + revenue_ = input.readFloat(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + taxes_ = + com.google.protobuf.MapField.newMapField(TaxesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry taxes__ = + input.readMessage( + TaxesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + taxes_.getMutableMap().put(taxes__.getKey(), taxes__.getValue()); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + costs_ = + com.google.protobuf.MapField.newMapField(CostsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry costs__ = + input.readMessage( + CostsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + costs_.getMutableMap().put(costs__.getKey(), costs__.getValue()); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + currencyCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetTaxes(); + case 4: + return internalGetCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.class, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Optional. The transaction ID with a length limit of 128 bytes.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The transaction ID with a length limit of 128 bytes.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVENUE_FIELD_NUMBER = 2; + private float revenue_; + /** + * + * + *
+   * Required. Total revenue or grand total associated with the transaction.
+   * This value include shipping, tax, or other adjustments to total revenue
+   * that you want to include as part of your revenue calculations. This field
+   * is not required if the event type is `refund`.
+   * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + public float getRevenue() { + return revenue_; + } + + public static final int TAXES_FIELD_NUMBER = 3; + + private static final class TaxesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_TaxesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.FLOAT, + 0F); + } + + private com.google.protobuf.MapField taxes_; + + private com.google.protobuf.MapField internalGetTaxes() { + if (taxes_ == null) { + return com.google.protobuf.MapField.emptyMapField(TaxesDefaultEntryHolder.defaultEntry); + } + return taxes_; + } + + public int getTaxesCount() { + return internalGetTaxes().getMap().size(); + } + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsTaxes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetTaxes().getMap().containsKey(key); + } + /** Use {@link #getTaxesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getTaxes() { + return getTaxesMap(); + } + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getTaxesMap() { + return internalGetTaxes().getMap(); + } + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getTaxesOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetTaxes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getTaxesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetTaxes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int COSTS_FIELD_NUMBER = 4; + + private static final class CostsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_CostsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.FLOAT, + 0F); + } + + private com.google.protobuf.MapField costs_; + + private com.google.protobuf.MapField internalGetCosts() { + if (costs_ == null) { + return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry); + } + return costs_; + } + + public int getCostsCount() { + return internalGetCosts().getMap().size(); + } + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsCosts(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetCosts().getMap().containsKey(key); + } + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getCosts() { + return getCostsMap(); + } + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getCostsMap() { + return internalGetCosts().getMap(); + } + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 6; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code. This field
+   * is not required if the event type is `refund`.
+   * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code. This field
+   * is not required if the event type is `refund`.
+   * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (revenue_ != 0F) { + output.writeFloat(2, revenue_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTaxes(), TaxesDefaultEntryHolder.defaultEntry, 3); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetCosts(), CostsDefaultEntryHolder.defaultEntry, 4); + if (!getCurrencyCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, currencyCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (revenue_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, revenue_); + } + for (java.util.Map.Entry entry : + internalGetTaxes().getMap().entrySet()) { + com.google.protobuf.MapEntry taxes__ = + TaxesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, taxes__); + } + for (java.util.Map.Entry entry : + internalGetCosts().getMap().entrySet()) { + com.google.protobuf.MapEntry costs__ = + CostsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, costs__); + } + if (!getCurrencyCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, currencyCode_); + } + 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.recommendationengine.v1beta1.PurchaseTransaction)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction other = + (com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction) obj; + + if (!getId().equals(other.getId())) return false; + if (java.lang.Float.floatToIntBits(getRevenue()) + != java.lang.Float.floatToIntBits(other.getRevenue())) return false; + if (!internalGetTaxes().equals(other.internalGetTaxes())) return false; + if (!internalGetCosts().equals(other.internalGetCosts())) return false; + if (!getCurrencyCode().equals(other.getCurrencyCode())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + REVENUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRevenue()); + if (!internalGetTaxes().getMap().isEmpty()) { + hash = (37 * hash) + TAXES_FIELD_NUMBER; + hash = (53 * hash) + internalGetTaxes().hashCode(); + } + if (!internalGetCosts().getMap().isEmpty()) { + hash = (37 * hash) + COSTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetCosts().hashCode(); + } + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction 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.recommendationengine.v1beta1.PurchaseTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction 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.recommendationengine.v1beta1.PurchaseTransaction parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction 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.recommendationengine.v1beta1.PurchaseTransaction + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction + 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.recommendationengine.v1beta1.PurchaseTransaction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction 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.recommendationengine.v1beta1.PurchaseTransaction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurchaseTransaction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PurchaseTransaction) + com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetTaxes(); + case 4: + return internalGetCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableTaxes(); + case 4: + return internalGetMutableCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.class, + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.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(); + id_ = ""; + + revenue_ = 0F; + + internalGetMutableTaxes().clear(); + internalGetMutableCosts().clear(); + currencyCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction build() { + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction result = + new com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + result.revenue_ = revenue_; + result.taxes_ = internalGetTaxes(); + result.taxes_.makeImmutable(); + result.costs_ = internalGetCosts(); + result.costs_.makeImmutable(); + result.currencyCode_ = currencyCode_; + 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.recommendationengine.v1beta1.PurchaseTransaction) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.getRevenue() != 0F) { + setRevenue(other.getRevenue()); + } + internalGetMutableTaxes().mergeFrom(other.internalGetTaxes()); + internalGetMutableCosts().mergeFrom(other.internalGetCosts()); + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Optional. The transaction ID with a length limit of 128 bytes.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The transaction ID with a length limit of 128 bytes.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The transaction ID with a length limit of 128 bytes.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The transaction ID with a length limit of 128 bytes.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The transaction ID with a length limit of 128 bytes.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private float revenue_; + /** + * + * + *
+     * Required. Total revenue or grand total associated with the transaction.
+     * This value include shipping, tax, or other adjustments to total revenue
+     * that you want to include as part of your revenue calculations. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + public float getRevenue() { + return revenue_; + } + /** + * + * + *
+     * Required. Total revenue or grand total associated with the transaction.
+     * This value include shipping, tax, or other adjustments to total revenue
+     * that you want to include as part of your revenue calculations. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The revenue to set. + * @return This builder for chaining. + */ + public Builder setRevenue(float value) { + + revenue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Total revenue or grand total associated with the transaction.
+     * This value include shipping, tax, or other adjustments to total revenue
+     * that you want to include as part of your revenue calculations. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRevenue() { + + revenue_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.MapField taxes_; + + private com.google.protobuf.MapField internalGetTaxes() { + if (taxes_ == null) { + return com.google.protobuf.MapField.emptyMapField(TaxesDefaultEntryHolder.defaultEntry); + } + return taxes_; + } + + private com.google.protobuf.MapField + internalGetMutableTaxes() { + onChanged(); + ; + if (taxes_ == null) { + taxes_ = com.google.protobuf.MapField.newMapField(TaxesDefaultEntryHolder.defaultEntry); + } + if (!taxes_.isMutable()) { + taxes_ = taxes_.copy(); + } + return taxes_; + } + + public int getTaxesCount() { + return internalGetTaxes().getMap().size(); + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsTaxes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetTaxes().getMap().containsKey(key); + } + /** Use {@link #getTaxesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getTaxes() { + return getTaxesMap(); + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getTaxesMap() { + return internalGetTaxes().getMap(); + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getTaxesOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetTaxes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getTaxesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetTaxes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTaxes() { + internalGetMutableTaxes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeTaxes(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableTaxes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTaxes() { + return internalGetMutableTaxes().getMutableMap(); + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putTaxes(java.lang.String key, float value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + + internalGetMutableTaxes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. All the taxes associated with the transaction.
+     * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllTaxes(java.util.Map values) { + internalGetMutableTaxes().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField costs_; + + private com.google.protobuf.MapField internalGetCosts() { + if (costs_ == null) { + return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry); + } + return costs_; + } + + private com.google.protobuf.MapField + internalGetMutableCosts() { + onChanged(); + ; + if (costs_ == null) { + costs_ = com.google.protobuf.MapField.newMapField(CostsDefaultEntryHolder.defaultEntry); + } + if (!costs_.isMutable()) { + costs_ = costs_.copy(); + } + return costs_; + } + + public int getCostsCount() { + return internalGetCosts().getMap().size(); + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsCosts(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetCosts().getMap().containsKey(key); + } + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getCosts() { + return getCostsMap(); + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getCostsMap() { + return internalGetCosts().getMap(); + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public float getCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCosts() { + internalGetMutableCosts().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeCosts(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableCosts().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableCosts() { + return internalGetMutableCosts().getMutableMap(); + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putCosts(java.lang.String key, float value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + + internalGetMutableCosts().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. All the costs associated with the product. These can be
+     * manufacturing costs, shipping expenses not borne by the end user, or any
+     * other costs.
+     * Total product cost such that
+     *   profit = revenue - (sum(taxes) + sum(costs))
+     * If product_cost is not set, then
+     *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+     * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+     * based profit *cannot* be calculated for this Transaction.
+     * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllCosts(java.util.Map values) { + internalGetMutableCosts().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code. This field
+     * is not required if the event type is `refund`.
+     * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = 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.recommendationengine.v1beta1.PurchaseTransaction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PurchaseTransaction) + private static final com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurchaseTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurchaseTransaction(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.recommendationengine.v1beta1.PurchaseTransaction + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurchaseTransactionOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurchaseTransactionOrBuilder.java new file mode 100644 index 00000000..64493634 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurchaseTransactionOrBuilder.java @@ -0,0 +1,241 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PurchaseTransactionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PurchaseTransaction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The transaction ID with a length limit of 128 bytes.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Optional. The transaction ID with a length limit of 128 bytes.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Required. Total revenue or grand total associated with the transaction.
+   * This value include shipping, tax, or other adjustments to total revenue
+   * that you want to include as part of your revenue calculations. This field
+   * is not required if the event type is `refund`.
+   * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + float getRevenue(); + + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getTaxesCount(); + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsTaxes(java.lang.String key); + /** Use {@link #getTaxesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTaxes(); + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getTaxesMap(); + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + float getTaxesOrDefault(java.lang.String key, float defaultValue); + /** + * + * + *
+   * Optional. All the taxes associated with the transaction.
+   * 
+ * + * map<string, float> taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + float getTaxesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getCostsCount(); + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsCosts(java.lang.String key); + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getCosts(); + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getCostsMap(); + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + float getCostsOrDefault(java.lang.String key, float defaultValue); + /** + * + * + *
+   * Optional. All the costs associated with the product. These can be
+   * manufacturing costs, shipping expenses not borne by the end user, or any
+   * other costs.
+   * Total product cost such that
+   *   profit = revenue - (sum(taxes) + sum(costs))
+   * If product_cost is not set, then
+   *   profit = revenue - tax - shipping - sum(CatalogItem.costs).
+   * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
+   * based profit *cannot* be calculated for this Transaction.
+   * 
+ * + * map<string, float> costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + float getCostsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code. This field
+   * is not required if the event type is `refund`.
+   * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code. This field
+   * is not required if the event type is `refund`.
+   * 
+ * + * string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsMetadata.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsMetadata.java new file mode 100644 index 00000000..d15ec54e --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsMetadata.java @@ -0,0 +1,917 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Metadata related to the progress of the PurgeUserEvents operation.
+ * This will be returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata} + */ +public final class PurgeUserEventsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) + PurgeUserEventsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsMetadata.newBuilder() to construct. + private PurgeUserEventsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsMetadata() { + operationName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsMetadata( + 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(); + + operationName_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata.class, + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata.Builder.class); + } + + public static final int OPERATION_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object operationName_; + /** + * + * + *
+   * The ID of the request / operation.
+   * 
+ * + * string operation_name = 1; + * + * @return The operationName. + */ + public java.lang.String getOperationName() { + java.lang.Object ref = operationName_; + 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(); + operationName_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the request / operation.
+   * 
+ * + * string operation_name = 1; + * + * @return The bytes for operationName. + */ + public com.google.protobuf.ByteString getOperationNameBytes() { + java.lang.Object ref = operationName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + 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 (!getOperationNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationName_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationName_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + 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.recommendationengine.v1beta1.PurgeUserEventsMetadata)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata other = + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) obj; + + if (!getOperationName().equals(other.getOperationName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) 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) + OPERATION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOperationName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata 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.recommendationengine.v1beta1.PurgeUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata 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.recommendationengine.v1beta1.PurgeUserEventsMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata 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.recommendationengine.v1beta1.PurgeUserEventsMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + 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.recommendationengine.v1beta1.PurgeUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata 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.recommendationengine.v1beta1.PurgeUserEventsMetadata 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; + } + /** + * + * + *
+   * Metadata related to the progress of the PurgeUserEvents operation.
+   * This will be returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata.class, + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata.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(); + operationName_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata build() { + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata result = + new com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata(this); + result.operationName_ = operationName_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.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.recommendationengine.v1beta1.PurgeUserEventsMetadata) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + .getDefaultInstance()) return this; + if (!other.getOperationName().isEmpty()) { + operationName_ = other.operationName_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + 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.recommendationengine.v1beta1.PurgeUserEventsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object operationName_ = ""; + /** + * + * + *
+     * The ID of the request / operation.
+     * 
+ * + * string operation_name = 1; + * + * @return The operationName. + */ + public java.lang.String getOperationName() { + java.lang.Object ref = operationName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the request / operation.
+     * 
+ * + * string operation_name = 1; + * + * @return The bytes for operationName. + */ + public com.google.protobuf.ByteString getOperationNameBytes() { + java.lang.Object ref = operationName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the request / operation.
+     * 
+ * + * string operation_name = 1; + * + * @param value The operationName to set. + * @return This builder for chaining. + */ + public Builder setOperationName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the request / operation.
+     * 
+ * + * string operation_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationName() { + + operationName_ = getDefaultInstance().getOperationName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the request / operation.
+     * 
+ * + * string operation_name = 1; + * + * @param value The bytes for operationName to set. + * @return This builder for chaining. + */ + public Builder setOperationNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @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.recommendationengine.v1beta1.PurgeUserEventsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) + private static final com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsMetadata(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.recommendationengine.v1beta1.PurgeUserEventsMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsMetadataOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsMetadataOrBuilder.java new file mode 100644 index 00000000..afe3fa06 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsMetadataOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PurgeUserEventsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the request / operation.
+   * 
+ * + * string operation_name = 1; + * + * @return The operationName. + */ + java.lang.String getOperationName(); + /** + * + * + *
+   * The ID of the request / operation.
+   * 
+ * + * string operation_name = 1; + * + * @return The bytes for operationName. + */ + com.google.protobuf.ByteString getOperationNameBytes(); + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsRequest.java new file mode 100644 index 00000000..77a4d3c2 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsRequest.java @@ -0,0 +1,1052 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for PurgeUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest} + */ +public final class PurgeUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) + PurgeUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsRequest.newBuilder() to construct. + private PurgeUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + force_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.class, + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the event_store under which the events are
+   * created. The format is
+   * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the event_store under which the events are
+   * created. The format is
+   * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted. Empty
+   * string filter is not allowed. This filter can also be used with
+   * ListUserEvents API to list events that will be deleted. The eligible fields
+   * for filtering are:
+   * * eventType - UserEvent.eventType field of type string.
+   * * eventTime - in ISO 8601 "zulu" format.
+   * * visitorId - field of type string. Specifying this will delete all events
+   * associated with a visitor.
+   * * userId - field of type string. Specifying this will delete all events
+   * associated with a user.
+   * Example 1: Deleting all events in a time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+   * "2012-04-23T18:30:43.511Z"`
+   * Example 2: Deleting specific eventType in time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * Example 3: Deleting all events for a specific visitor
+   * `visitorId = visitor1024`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted. Empty
+   * string filter is not allowed. This filter can also be used with
+   * ListUserEvents API to list events that will be deleted. The eligible fields
+   * for filtering are:
+   * * eventType - UserEvent.eventType field of type string.
+   * * eventTime - in ISO 8601 "zulu" format.
+   * * visitorId - field of type string. Specifying this will delete all events
+   * associated with a visitor.
+   * * userId - field of type string. Specifying this will delete all events
+   * associated with a user.
+   * Example 1: Deleting all events in a time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+   * "2012-04-23T18:30:43.511Z"`
+   * Example 2: Deleting specific eventType in time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * Example 3: Deleting all events for a specific visitor
+   * `visitorId = visitor1024`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 3; + private boolean force_; + /** + * + * + *
+   * Optional. The default value is false. Override this flag to true to
+   * actually perform the purge. If the field is not set to true, a sampling of
+   * events to be deleted will be returned.
+   * 
+ * + * bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + public boolean getForce() { + return force_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (force_ != false) { + output.writeBool(3, force_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, force_); + } + 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.recommendationengine.v1beta1.PurgeUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest other = + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getForce() != other.getForce()) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest 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.recommendationengine.v1beta1.PurgeUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest 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.recommendationengine.v1beta1.PurgeUserEventsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest 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.recommendationengine.v1beta1.PurgeUserEventsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + 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.recommendationengine.v1beta1.PurgeUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest 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.recommendationengine.v1beta1.PurgeUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for PurgeUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.class, + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.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(); + parent_ = ""; + + filter_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest build() { + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest result = + new com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.force_ = force_; + 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.recommendationengine.v1beta1.PurgeUserEventsRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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.recommendationengine.v1beta1.PurgeUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the event_store under which the events are
+     * created. The format is
+     * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the event_store under which the events are
+     * created. The format is
+     * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the event_store under which the events are
+     * created. The format is
+     * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the event_store under which the events are
+     * created. The format is
+     * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the event_store under which the events are
+     * created. The format is
+     * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted. Empty
+     * string filter is not allowed. This filter can also be used with
+     * ListUserEvents API to list events that will be deleted. The eligible fields
+     * for filtering are:
+     * * eventType - UserEvent.eventType field of type string.
+     * * eventTime - in ISO 8601 "zulu" format.
+     * * visitorId - field of type string. Specifying this will delete all events
+     * associated with a visitor.
+     * * userId - field of type string. Specifying this will delete all events
+     * associated with a user.
+     * Example 1: Deleting all events in a time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+     * "2012-04-23T18:30:43.511Z"`
+     * Example 2: Deleting specific eventType in time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * Example 3: Deleting all events for a specific visitor
+     * `visitorId = visitor1024`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted. Empty
+     * string filter is not allowed. This filter can also be used with
+     * ListUserEvents API to list events that will be deleted. The eligible fields
+     * for filtering are:
+     * * eventType - UserEvent.eventType field of type string.
+     * * eventTime - in ISO 8601 "zulu" format.
+     * * visitorId - field of type string. Specifying this will delete all events
+     * associated with a visitor.
+     * * userId - field of type string. Specifying this will delete all events
+     * associated with a user.
+     * Example 1: Deleting all events in a time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+     * "2012-04-23T18:30:43.511Z"`
+     * Example 2: Deleting specific eventType in time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * Example 3: Deleting all events for a specific visitor
+     * `visitorId = visitor1024`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted. Empty
+     * string filter is not allowed. This filter can also be used with
+     * ListUserEvents API to list events that will be deleted. The eligible fields
+     * for filtering are:
+     * * eventType - UserEvent.eventType field of type string.
+     * * eventTime - in ISO 8601 "zulu" format.
+     * * visitorId - field of type string. Specifying this will delete all events
+     * associated with a visitor.
+     * * userId - field of type string. Specifying this will delete all events
+     * associated with a user.
+     * Example 1: Deleting all events in a time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+     * "2012-04-23T18:30:43.511Z"`
+     * Example 2: Deleting specific eventType in time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * Example 3: Deleting all events for a specific visitor
+     * `visitorId = visitor1024`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted. Empty
+     * string filter is not allowed. This filter can also be used with
+     * ListUserEvents API to list events that will be deleted. The eligible fields
+     * for filtering are:
+     * * eventType - UserEvent.eventType field of type string.
+     * * eventTime - in ISO 8601 "zulu" format.
+     * * visitorId - field of type string. Specifying this will delete all events
+     * associated with a visitor.
+     * * userId - field of type string. Specifying this will delete all events
+     * associated with a user.
+     * Example 1: Deleting all events in a time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+     * "2012-04-23T18:30:43.511Z"`
+     * Example 2: Deleting specific eventType in time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * Example 3: Deleting all events for a specific visitor
+     * `visitorId = visitor1024`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted. Empty
+     * string filter is not allowed. This filter can also be used with
+     * ListUserEvents API to list events that will be deleted. The eligible fields
+     * for filtering are:
+     * * eventType - UserEvent.eventType field of type string.
+     * * eventTime - in ISO 8601 "zulu" format.
+     * * visitorId - field of type string. Specifying this will delete all events
+     * associated with a visitor.
+     * * userId - field of type string. Specifying this will delete all events
+     * associated with a user.
+     * Example 1: Deleting all events in a time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+     * "2012-04-23T18:30:43.511Z"`
+     * Example 2: Deleting specific eventType in time range.
+     * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * Example 3: Deleting all events for a specific visitor
+     * `visitorId = visitor1024`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Optional. The default value is false. Override this flag to true to
+     * actually perform the purge. If the field is not set to true, a sampling of
+     * events to be deleted will be returned.
+     * 
+ * + * bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. The default value is false. Override this flag to true to
+     * actually perform the purge. If the field is not set to true, a sampling of
+     * events to be deleted will be returned.
+     * 
+ * + * bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The default value is false. Override this flag to true to
+     * actually perform the purge. If the field is not set to true, a sampling of
+     * events to be deleted will be returned.
+     * 
+ * + * bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) + private static final com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsRequest(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.recommendationengine.v1beta1.PurgeUserEventsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..3bae543f --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PurgeUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the event_store under which the events are
+   * created. The format is
+   * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the event_store under which the events are
+   * created. The format is
+   * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted. Empty
+   * string filter is not allowed. This filter can also be used with
+   * ListUserEvents API to list events that will be deleted. The eligible fields
+   * for filtering are:
+   * * eventType - UserEvent.eventType field of type string.
+   * * eventTime - in ISO 8601 "zulu" format.
+   * * visitorId - field of type string. Specifying this will delete all events
+   * associated with a visitor.
+   * * userId - field of type string. Specifying this will delete all events
+   * associated with a user.
+   * Example 1: Deleting all events in a time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+   * "2012-04-23T18:30:43.511Z"`
+   * Example 2: Deleting specific eventType in time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * Example 3: Deleting all events for a specific visitor
+   * `visitorId = visitor1024`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted. Empty
+   * string filter is not allowed. This filter can also be used with
+   * ListUserEvents API to list events that will be deleted. The eligible fields
+   * for filtering are:
+   * * eventType - UserEvent.eventType field of type string.
+   * * eventTime - in ISO 8601 "zulu" format.
+   * * visitorId - field of type string. Specifying this will delete all events
+   * associated with a visitor.
+   * * userId - field of type string. Specifying this will delete all events
+   * associated with a user.
+   * Example 1: Deleting all events in a time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+   * "2012-04-23T18:30:43.511Z"`
+   * Example 2: Deleting specific eventType in time range.
+   * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * Example 3: Deleting all events for a specific visitor
+   * `visitorId = visitor1024`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The default value is false. Override this flag to true to
+   * actually perform the purge. If the field is not set to true, a sampling of
+   * events to be deleted will be returned.
+   * 
+ * + * bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsResponse.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsResponse.java new file mode 100644 index 00000000..579f1c28 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsResponse.java @@ -0,0 +1,1118 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Response of the PurgeUserEventsRequest. If the long running operation is
+ * successfully done, then this message is returned by the
+ * google.longrunning.Operations.response field.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse} + */ +public final class PurgeUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) + PurgeUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsResponse.newBuilder() to construct. + private PurgeUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsResponse() { + userEventsSample_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + purgedEventsCount_ = input.readInt64(); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + userEventsSample_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.UserEvent>(); + mutable_bitField0_ |= 0x00000001; + } + userEventsSample_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEvent.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + userEventsSample_ = java.util.Collections.unmodifiableList(userEventsSample_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse.class, + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse.Builder.class); + } + + public static final int PURGED_EVENTS_COUNT_FIELD_NUMBER = 1; + private long purgedEventsCount_; + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + public long getPurgedEventsCount() { + return purgedEventsCount_; + } + + public static final int USER_EVENTS_SAMPLE_FIELD_NUMBER = 2; + private java.util.List userEventsSample_; + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public java.util.List + getUserEventsSampleList() { + return userEventsSample_; + } + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public java.util.List + getUserEventsSampleOrBuilderList() { + return userEventsSample_; + } + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public int getUserEventsSampleCount() { + return userEventsSample_.size(); + } + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEventsSample(int index) { + return userEventsSample_.get(index); + } + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder + getUserEventsSampleOrBuilder(int index) { + return userEventsSample_.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 (purgedEventsCount_ != 0L) { + output.writeInt64(1, purgedEventsCount_); + } + for (int i = 0; i < userEventsSample_.size(); i++) { + output.writeMessage(2, userEventsSample_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (purgedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, purgedEventsCount_); + } + for (int i = 0; i < userEventsSample_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, userEventsSample_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse other = + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) obj; + + if (getPurgedEventsCount() != other.getPurgedEventsCount()) return false; + if (!getUserEventsSampleList().equals(other.getUserEventsSampleList())) 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) + PURGED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPurgedEventsCount()); + if (getUserEventsSampleCount() > 0) { + hash = (37 * hash) + USER_EVENTS_SAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getUserEventsSampleList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse 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.recommendationengine.v1beta1.PurgeUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse 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.recommendationengine.v1beta1.PurgeUserEventsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse 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.recommendationengine.v1beta1.PurgeUserEventsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + 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.recommendationengine.v1beta1.PurgeUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse 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.recommendationengine.v1beta1.PurgeUserEventsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the PurgeUserEventsRequest. If the long running operation is
+   * successfully done, then this message is returned by the
+   * google.longrunning.Operations.response field.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse.class, + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserEventsSampleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + purgedEventsCount_ = 0L; + + if (userEventsSampleBuilder_ == null) { + userEventsSample_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + userEventsSampleBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse build() { + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse buildPartial() { + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse result = + new com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse(this); + int from_bitField0_ = bitField0_; + result.purgedEventsCount_ = purgedEventsCount_; + if (userEventsSampleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + userEventsSample_ = java.util.Collections.unmodifiableList(userEventsSample_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.userEventsSample_ = userEventsSample_; + } else { + result.userEventsSample_ = userEventsSampleBuilder_.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.recommendationengine.v1beta1.PurgeUserEventsResponse) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + .getDefaultInstance()) return this; + if (other.getPurgedEventsCount() != 0L) { + setPurgedEventsCount(other.getPurgedEventsCount()); + } + if (userEventsSampleBuilder_ == null) { + if (!other.userEventsSample_.isEmpty()) { + if (userEventsSample_.isEmpty()) { + userEventsSample_ = other.userEventsSample_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUserEventsSampleIsMutable(); + userEventsSample_.addAll(other.userEventsSample_); + } + onChanged(); + } + } else { + if (!other.userEventsSample_.isEmpty()) { + if (userEventsSampleBuilder_.isEmpty()) { + userEventsSampleBuilder_.dispose(); + userEventsSampleBuilder_ = null; + userEventsSample_ = other.userEventsSample_; + bitField0_ = (bitField0_ & ~0x00000001); + userEventsSampleBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUserEventsSampleFieldBuilder() + : null; + } else { + userEventsSampleBuilder_.addAllMessages(other.userEventsSample_); + } + } + } + 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.recommendationengine.v1beta1.PurgeUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long purgedEventsCount_; + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + public long getPurgedEventsCount() { + return purgedEventsCount_; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @param value The purgedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setPurgedEventsCount(long value) { + + purgedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPurgedEventsCount() { + + purgedEventsCount_ = 0L; + onChanged(); + return this; + } + + private java.util.List + userEventsSample_ = java.util.Collections.emptyList(); + + private void ensureUserEventsSampleIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + userEventsSample_ = + new java.util.ArrayList( + userEventsSample_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + userEventsSampleBuilder_; + + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public java.util.List + getUserEventsSampleList() { + if (userEventsSampleBuilder_ == null) { + return java.util.Collections.unmodifiableList(userEventsSample_); + } else { + return userEventsSampleBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public int getUserEventsSampleCount() { + if (userEventsSampleBuilder_ == null) { + return userEventsSample_.size(); + } else { + return userEventsSampleBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEventsSample(int index) { + if (userEventsSampleBuilder_ == null) { + return userEventsSample_.get(index); + } else { + return userEventsSampleBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder setUserEventsSample( + int index, com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsSampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsSampleIsMutable(); + userEventsSample_.set(index, value); + onChanged(); + } else { + userEventsSampleBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder setUserEventsSample( + int index, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsSampleBuilder_ == null) { + ensureUserEventsSampleIsMutable(); + userEventsSample_.set(index, builderForValue.build()); + onChanged(); + } else { + userEventsSampleBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder addUserEventsSample( + com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsSampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsSampleIsMutable(); + userEventsSample_.add(value); + onChanged(); + } else { + userEventsSampleBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder addUserEventsSample( + int index, com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsSampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsSampleIsMutable(); + userEventsSample_.add(index, value); + onChanged(); + } else { + userEventsSampleBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder addUserEventsSample( + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsSampleBuilder_ == null) { + ensureUserEventsSampleIsMutable(); + userEventsSample_.add(builderForValue.build()); + onChanged(); + } else { + userEventsSampleBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder addUserEventsSample( + int index, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsSampleBuilder_ == null) { + ensureUserEventsSampleIsMutable(); + userEventsSample_.add(index, builderForValue.build()); + onChanged(); + } else { + userEventsSampleBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder addAllUserEventsSample( + java.lang.Iterable + values) { + if (userEventsSampleBuilder_ == null) { + ensureUserEventsSampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, userEventsSample_); + onChanged(); + } else { + userEventsSampleBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder clearUserEventsSample() { + if (userEventsSampleBuilder_ == null) { + userEventsSample_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + userEventsSampleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public Builder removeUserEventsSample(int index) { + if (userEventsSampleBuilder_ == null) { + ensureUserEventsSampleIsMutable(); + userEventsSample_.remove(index); + onChanged(); + } else { + userEventsSampleBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder + getUserEventsSampleBuilder(int index) { + return getUserEventsSampleFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder + getUserEventsSampleOrBuilder(int index) { + if (userEventsSampleBuilder_ == null) { + return userEventsSample_.get(index); + } else { + return userEventsSampleBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventsSampleOrBuilderList() { + if (userEventsSampleBuilder_ != null) { + return userEventsSampleBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(userEventsSample_); + } + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder + addUserEventsSampleBuilder() { + return getUserEventsSampleFieldBuilder() + .addBuilder(com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder + addUserEventsSampleBuilder(int index) { + return getUserEventsSampleFieldBuilder() + .addBuilder( + index, com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * A sampling of events deleted (or will be deleted) depending on the `force`
+     * property in the request. Max of 500 items will be returned.
+     * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + public java.util.List + getUserEventsSampleBuilderList() { + return getUserEventsSampleFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventsSampleFieldBuilder() { + if (userEventsSampleBuilder_ == null) { + userEventsSampleBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder>( + userEventsSample_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + userEventsSample_ = null; + } + return userEventsSampleBuilder_; + } + + @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.recommendationengine.v1beta1.PurgeUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) + private static final com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse(); + } + + public static com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsResponse(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.recommendationengine.v1beta1.PurgeUserEventsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsResponseOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..5535c83b --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/PurgeUserEventsResponseOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface PurgeUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + long getPurgedEventsCount(); + + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + java.util.List getUserEventsSampleList(); + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEventsSample(int index); + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + int getUserEventsSampleCount(); + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + java.util.List + getUserEventsSampleOrBuilderList(); + /** + * + * + *
+   * A sampling of events deleted (or will be deleted) depending on the `force`
+   * property in the request. Max of 500 items will be returned.
+   * 
+ * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsSampleOrBuilder( + int index); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UpdateCatalogItemRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UpdateCatalogItemRequest.java new file mode 100644 index 00000000..a24b1773 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UpdateCatalogItemRequest.java @@ -0,0 +1,1263 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for UpdateCatalogItem method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest} + */ +public final class UpdateCatalogItemRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) + UpdateCatalogItemRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCatalogItemRequest.newBuilder() to construct. + private UpdateCatalogItemRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCatalogItemRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCatalogItemRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCatalogItemRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder subBuilder = null; + if (catalogItem_ != null) { + subBuilder = catalogItem_.toBuilder(); + } + catalogItem_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalogItem_); + catalogItem_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATALOG_ITEM_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.CatalogItem catalogItem_; + /** + * + * + *
+   * Required. The catalog item to update/create. The 'catalog_item_id' field
+   * has to match that in the 'name'.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogItem field is set. + */ + public boolean hasCatalogItem() { + return catalogItem_ != null; + } + /** + * + * + *
+   * Required. The catalog item to update/create. The 'catalog_item_id' field
+   * has to match that in the 'name'.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogItem. + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem() { + return catalogItem_ == null + ? com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance() + : catalogItem_; + } + /** + * + * + *
+   * Required. The catalog item to update/create. The 'catalog_item_id' field
+   * has to match that in the 'name'.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemOrBuilder() { + return getCatalogItem(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'item' to update. If not
+   * set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'item' to update. If not
+   * set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'item' to update. If not
+   * set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (catalogItem_ != null) { + output.writeMessage(2, getCatalogItem()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (catalogItem_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCatalogItem()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + 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.recommendationengine.v1beta1.UpdateCatalogItemRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest other = + (com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCatalogItem() != other.hasCatalogItem()) return false; + if (hasCatalogItem()) { + if (!getCatalogItem().equals(other.getCatalogItem())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCatalogItem()) { + hash = (37 * hash) + CATALOG_ITEM_FIELD_NUMBER; + hash = (53 * hash) + getCatalogItem().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest 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.recommendationengine.v1beta1.UpdateCatalogItemRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest 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.recommendationengine.v1beta1.UpdateCatalogItemRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest 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.recommendationengine.v1beta1.UpdateCatalogItemRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + 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.recommendationengine.v1beta1.UpdateCatalogItemRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest 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.recommendationengine.v1beta1.UpdateCatalogItemRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for UpdateCatalogItem method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest.class, + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (catalogItemBuilder_ == null) { + catalogItem_ = null; + } else { + catalogItem_ = null; + catalogItemBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.CatalogServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UpdateCatalogItemRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest build() { + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest result = + new com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest(this); + result.name_ = name_; + if (catalogItemBuilder_ == null) { + result.catalogItem_ = catalogItem_; + } else { + result.catalogItem_ = catalogItemBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.recommendationengine.v1beta1.UpdateCatalogItemRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCatalogItem()) { + mergeCatalogItem(other.getCatalogItem()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.recommendationengine.v1beta1.UpdateCatalogItemRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of catalog item, such as
+     * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 com.google.cloud.recommendationengine.v1beta1.CatalogItem catalogItem_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + catalogItemBuilder_; + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogItem field is set. + */ + public boolean hasCatalogItem() { + return catalogItemBuilder_ != null || catalogItem_ != null; + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogItem. + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem() { + if (catalogItemBuilder_ == null) { + return catalogItem_ == null + ? com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance() + : catalogItem_; + } else { + return catalogItemBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogItem(com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalogItem_ = value; + onChanged(); + } else { + catalogItemBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder builderForValue) { + if (catalogItemBuilder_ == null) { + catalogItem_ = builderForValue.build(); + onChanged(); + } else { + catalogItemBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalogItem( + com.google.cloud.recommendationengine.v1beta1.CatalogItem value) { + if (catalogItemBuilder_ == null) { + if (catalogItem_ != null) { + catalogItem_ = + com.google.cloud.recommendationengine.v1beta1.CatalogItem.newBuilder(catalogItem_) + .mergeFrom(value) + .buildPartial(); + } else { + catalogItem_ = value; + } + onChanged(); + } else { + catalogItemBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalogItem() { + if (catalogItemBuilder_ == null) { + catalogItem_ = null; + onChanged(); + } else { + catalogItem_ = null; + catalogItemBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder + getCatalogItemBuilder() { + + onChanged(); + return getCatalogItemFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder + getCatalogItemOrBuilder() { + if (catalogItemBuilder_ != null) { + return catalogItemBuilder_.getMessageOrBuilder(); + } else { + return catalogItem_ == null + ? com.google.cloud.recommendationengine.v1beta1.CatalogItem.getDefaultInstance() + : catalogItem_; + } + } + /** + * + * + *
+     * Required. The catalog item to update/create. The 'catalog_item_id' field
+     * has to match that in the 'name'.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder> + getCatalogItemFieldBuilder() { + if (catalogItemBuilder_ == null) { + catalogItemBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.CatalogItem, + com.google.cloud.recommendationengine.v1beta1.CatalogItem.Builder, + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder>( + getCatalogItem(), getParentForChildren(), isClean()); + catalogItem_ = null; + } + return catalogItemBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'item' to update. If not
+     * set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.recommendationengine.v1beta1.UpdateCatalogItemRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) + private static final com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCatalogItemRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCatalogItemRequest(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.recommendationengine.v1beta1.UpdateCatalogItemRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UpdateCatalogItemRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UpdateCatalogItemRequestOrBuilder.java new file mode 100644 index 00000000..b05c8975 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UpdateCatalogItemRequestOrBuilder.java @@ -0,0 +1,137 @@ +/* + * 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/recommendationengine/v1beta1/catalog_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface UpdateCatalogItemRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of catalog item, such as
+   * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The catalog item to update/create. The 'catalog_item_id' field
+   * has to match that in the 'name'.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogItem field is set. + */ + boolean hasCatalogItem(); + /** + * + * + *
+   * Required. The catalog item to update/create. The 'catalog_item_id' field
+   * has to match that in the 'name'.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogItem. + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItem getCatalogItem(); + /** + * + * + *
+   * Required. The catalog item to update/create. The 'catalog_item_id' field
+   * has to match that in the 'name'.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.CatalogItemOrBuilder getCatalogItemOrBuilder(); + + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'item' to update. If not
+   * set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'item' to update. If not
+   * set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'item' to update. If not
+   * set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEvent.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEvent.java new file mode 100644 index 00000000..55089cf9 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEvent.java @@ -0,0 +1,2524 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * UserEvent captures all metadata information recommendation engine needs to
+ * know about how end users interact with customers' website.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserEvent} + */ +public final class UserEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.UserEvent) + UserEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEvent.newBuilder() to construct. + private UserEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEvent() { + eventType_ = ""; + eventSource_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEvent( + 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(); + + eventType_ = s; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder subBuilder = null; + if (userInfo_ != null) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder subBuilder = null; + if (eventDetail_ != null) { + subBuilder = eventDetail_.toBuilder(); + } + eventDetail_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.EventDetail.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventDetail_); + eventDetail_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder subBuilder = + null; + if (productEventDetail_ != null) { + subBuilder = productEventDetail_.toBuilder(); + } + productEventDetail_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productEventDetail_); + productEventDetail_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (eventTime_ != null) { + subBuilder = eventTime_.toBuilder(); + } + eventTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTime_); + eventTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + int rawValue = input.readEnum(); + + eventSource_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserEvent.class, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder.class); + } + + /** + * + * + *
+   * User event source.
+   * 
+ * + * Protobuf enum {@code google.cloud.recommendationengine.v1beta1.UserEvent.EventSource} + */ + public enum EventSource implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified event source.
+     * 
+ * + * EVENT_SOURCE_UNSPECIFIED = 0; + */ + EVENT_SOURCE_UNSPECIFIED(0), + /** + * + * + *
+     * The event is ingested via a javascript pixel or Recommendations AI Tag
+     * through automl datalayer or JS Macros.
+     * 
+ * + * AUTOML = 1; + */ + AUTOML(1), + /** + * + * + *
+     * The event is ingested via Recommendations AI Tag through Enhanced
+     * Ecommerce datalayer.
+     * 
+ * + * ECOMMERCE = 2; + */ + ECOMMERCE(2), + /** + * + * + *
+     * The event is ingested via Import user events API.
+     * 
+ * + * BATCH_UPLOAD = 3; + */ + BATCH_UPLOAD(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified event source.
+     * 
+ * + * EVENT_SOURCE_UNSPECIFIED = 0; + */ + public static final int EVENT_SOURCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The event is ingested via a javascript pixel or Recommendations AI Tag
+     * through automl datalayer or JS Macros.
+     * 
+ * + * AUTOML = 1; + */ + public static final int AUTOML_VALUE = 1; + /** + * + * + *
+     * The event is ingested via Recommendations AI Tag through Enhanced
+     * Ecommerce datalayer.
+     * 
+ * + * ECOMMERCE = 2; + */ + public static final int ECOMMERCE_VALUE = 2; + /** + * + * + *
+     * The event is ingested via Import user events API.
+     * 
+ * + * BATCH_UPLOAD = 3; + */ + public static final int BATCH_UPLOAD_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventSource 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 EventSource forNumber(int value) { + switch (value) { + case 0: + return EVENT_SOURCE_UNSPECIFIED; + case 1: + return AUTOML; + case 2: + return ECOMMERCE; + case 3: + return BATCH_UPLOAD; + 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 EventSource findValueByNumber(int number) { + return EventSource.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEvent.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EventSource[] VALUES = values(); + + public static EventSource 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 EventSource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recommendationengine.v1beta1.UserEvent.EventSource) + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart` Products being added to cart.
+   * * `add-to-list` Items being added to a list (shopping list, favorites
+   *   etc).
+   * * `category-page-view` Special pages such as sale or promotion pages
+   *   viewed.
+   * * `checkout-start` User starting a checkout process.
+   * * `detail-page-view` Products detail page viewed.
+   * * `home-page-view` Homepage viewed.
+   * * `page-visit` Generic page visits not included in the event types above.
+   * * `purchase-complete` User finishing a purchase.
+   * * `refund` Purchased items being refunded or returned.
+   * * `remove-from-cart` Products being removed from cart.
+   * * `remove-from-list` Items being removed from a list.
+   * * `search` Product search.
+   * * `shopping-cart-page-view` User viewing a shopping cart.
+   * * `impression` List of items displayed. Used by Google Tag Manager.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + 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(); + eventType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart` Products being added to cart.
+   * * `add-to-list` Items being added to a list (shopping list, favorites
+   *   etc).
+   * * `category-page-view` Special pages such as sale or promotion pages
+   *   viewed.
+   * * `checkout-start` User starting a checkout process.
+   * * `detail-page-view` Products detail page viewed.
+   * * `home-page-view` Homepage viewed.
+   * * `page-visit` Generic page visits not included in the event types above.
+   * * `purchase-complete` User finishing a purchase.
+   * * `refund` Purchased items being refunded or returned.
+   * * `remove-from-cart` Products being removed from cart.
+   * * `remove-from-list` Items being removed from a list.
+   * * `search` Product search.
+   * * `shopping-cart-page-view` User viewing a shopping cart.
+   * * `impression` List of items displayed. Used by Google Tag Manager.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_INFO_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.UserInfo userInfo_; + /** + * + * + *
+   * Required. User information.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * Required. User information.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userInfo. + */ + public com.google.cloud.recommendationengine.v1beta1.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * Required. User information.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + public static final int EVENT_DETAIL_FIELD_NUMBER = 3; + private com.google.cloud.recommendationengine.v1beta1.EventDetail eventDetail_; + /** + * + * + *
+   * Optional. User event detailed information common across different
+   * recommendation types.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventDetail field is set. + */ + public boolean hasEventDetail() { + return eventDetail_ != null; + } + /** + * + * + *
+   * Optional. User event detailed information common across different
+   * recommendation types.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventDetail. + */ + public com.google.cloud.recommendationengine.v1beta1.EventDetail getEventDetail() { + return eventDetail_ == null + ? com.google.cloud.recommendationengine.v1beta1.EventDetail.getDefaultInstance() + : eventDetail_; + } + /** + * + * + *
+   * Optional. User event detailed information common across different
+   * recommendation types.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder + getEventDetailOrBuilder() { + return getEventDetail(); + } + + public static final int PRODUCT_EVENT_DETAIL_FIELD_NUMBER = 4; + private com.google.cloud.recommendationengine.v1beta1.ProductEventDetail productEventDetail_; + /** + * + * + *
+   * Optional. Retail product specific user event metadata.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `category-page-view`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * * `search`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+   *   set for this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `home-page-view`
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the productEventDetail field is set. + */ + public boolean hasProductEventDetail() { + return productEventDetail_ != null; + } + /** + * + * + *
+   * Optional. Retail product specific user event metadata.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `category-page-view`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * * `search`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+   *   set for this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `home-page-view`
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The productEventDetail. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail getProductEventDetail() { + return productEventDetail_ == null + ? com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance() + : productEventDetail_; + } + /** + * + * + *
+   * Optional. Retail product specific user event metadata.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `category-page-view`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * * `search`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+   *   set for this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `home-page-view`
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder + getProductEventDetailOrBuilder() { + return getProductEventDetail(); + } + + public static final int EVENT_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp eventTime_; + /** + * + * + *
+   * Optional. Only required for ImportUserEvents method. Timestamp of user
+   * event created.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTime_ != null; + } + /** + * + * + *
+   * Optional. Only required for ImportUserEvents method. Timestamp of user
+   * event created.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + /** + * + * + *
+   * Optional. Only required for ImportUserEvents method. Timestamp of user
+   * event created.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + return getEventTime(); + } + + public static final int EVENT_SOURCE_FIELD_NUMBER = 6; + private int eventSource_; + /** + * + * + *
+   * Optional. This field should *not* be set when using JavaScript pixel
+   * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for eventSource. + */ + public int getEventSourceValue() { + return eventSource_; + } + /** + * + * + *
+   * Optional. This field should *not* be set when using JavaScript pixel
+   * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventSource. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource getEventSource() { + @SuppressWarnings("deprecation") + com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource result = + com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource.valueOf(eventSource_); + return result == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource.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 (!getEventTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, eventType_); + } + if (userInfo_ != null) { + output.writeMessage(2, getUserInfo()); + } + if (eventDetail_ != null) { + output.writeMessage(3, getEventDetail()); + } + if (productEventDetail_ != null) { + output.writeMessage(4, getProductEventDetail()); + } + if (eventTime_ != null) { + output.writeMessage(5, getEventTime()); + } + if (eventSource_ + != com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource + .EVENT_SOURCE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, eventSource_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEventTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventType_); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserInfo()); + } + if (eventDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEventDetail()); + } + if (productEventDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getProductEventDetail()); + } + if (eventTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEventTime()); + } + if (eventSource_ + != com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource + .EVENT_SOURCE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, eventSource_); + } + 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.recommendationengine.v1beta1.UserEvent)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.UserEvent other = + (com.google.cloud.recommendationengine.v1beta1.UserEvent) obj; + + if (!getEventType().equals(other.getEventType())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (hasEventDetail() != other.hasEventDetail()) return false; + if (hasEventDetail()) { + if (!getEventDetail().equals(other.getEventDetail())) return false; + } + if (hasProductEventDetail() != other.hasProductEventDetail()) return false; + if (hasProductEventDetail()) { + if (!getProductEventDetail().equals(other.getProductEventDetail())) return false; + } + if (hasEventTime() != other.hasEventTime()) return false; + if (hasEventTime()) { + if (!getEventTime().equals(other.getEventTime())) return false; + } + if (eventSource_ != other.eventSource_) 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) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + if (hasEventDetail()) { + hash = (37 * hash) + EVENT_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getEventDetail().hashCode(); + } + if (hasProductEventDetail()) { + hash = (37 * hash) + PRODUCT_EVENT_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getProductEventDetail().hashCode(); + } + if (hasEventTime()) { + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEventTime().hashCode(); + } + hash = (37 * hash) + EVENT_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + eventSource_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent 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.recommendationengine.v1beta1.UserEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent 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.recommendationengine.v1beta1.UserEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent 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.recommendationengine.v1beta1.UserEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent 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.recommendationengine.v1beta1.UserEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent 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.recommendationengine.v1beta1.UserEvent 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; + } + /** + * + * + *
+   * UserEvent captures all metadata information recommendation engine needs to
+   * know about how end users interact with customers' website.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.UserEvent) + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserEvent.class, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.UserEvent.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(); + eventType_ = ""; + + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + if (eventDetailBuilder_ == null) { + eventDetail_ = null; + } else { + eventDetail_ = null; + eventDetailBuilder_ = null; + } + if (productEventDetailBuilder_ == null) { + productEventDetail_ = null; + } else { + productEventDetail_ = null; + productEventDetailBuilder_ = null; + } + if (eventTimeBuilder_ == null) { + eventTime_ = null; + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + eventSource_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEvent getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEvent build() { + com.google.cloud.recommendationengine.v1beta1.UserEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEvent buildPartial() { + com.google.cloud.recommendationengine.v1beta1.UserEvent result = + new com.google.cloud.recommendationengine.v1beta1.UserEvent(this); + result.eventType_ = eventType_; + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + if (eventDetailBuilder_ == null) { + result.eventDetail_ = eventDetail_; + } else { + result.eventDetail_ = eventDetailBuilder_.build(); + } + if (productEventDetailBuilder_ == null) { + result.productEventDetail_ = productEventDetail_; + } else { + result.productEventDetail_ = productEventDetailBuilder_.build(); + } + if (eventTimeBuilder_ == null) { + result.eventTime_ = eventTime_; + } else { + result.eventTime_ = eventTimeBuilder_.build(); + } + result.eventSource_ = eventSource_; + 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.recommendationengine.v1beta1.UserEvent) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.UserEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.UserEvent other) { + if (other == com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()) + return this; + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (other.hasEventDetail()) { + mergeEventDetail(other.getEventDetail()); + } + if (other.hasProductEventDetail()) { + mergeProductEventDetail(other.getProductEventDetail()); + } + if (other.hasEventTime()) { + mergeEventTime(other.getEventTime()); + } + if (other.eventSource_ != 0) { + setEventSourceValue(other.getEventSourceValue()); + } + 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.recommendationengine.v1beta1.UserEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.UserEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart` Products being added to cart.
+     * * `add-to-list` Items being added to a list (shopping list, favorites
+     *   etc).
+     * * `category-page-view` Special pages such as sale or promotion pages
+     *   viewed.
+     * * `checkout-start` User starting a checkout process.
+     * * `detail-page-view` Products detail page viewed.
+     * * `home-page-view` Homepage viewed.
+     * * `page-visit` Generic page visits not included in the event types above.
+     * * `purchase-complete` User finishing a purchase.
+     * * `refund` Purchased items being refunded or returned.
+     * * `remove-from-cart` Products being removed from cart.
+     * * `remove-from-list` Items being removed from a list.
+     * * `search` Product search.
+     * * `shopping-cart-page-view` User viewing a shopping cart.
+     * * `impression` List of items displayed. Used by Google Tag Manager.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart` Products being added to cart.
+     * * `add-to-list` Items being added to a list (shopping list, favorites
+     *   etc).
+     * * `category-page-view` Special pages such as sale or promotion pages
+     *   viewed.
+     * * `checkout-start` User starting a checkout process.
+     * * `detail-page-view` Products detail page viewed.
+     * * `home-page-view` Homepage viewed.
+     * * `page-visit` Generic page visits not included in the event types above.
+     * * `purchase-complete` User finishing a purchase.
+     * * `refund` Purchased items being refunded or returned.
+     * * `remove-from-cart` Products being removed from cart.
+     * * `remove-from-list` Items being removed from a list.
+     * * `search` Product search.
+     * * `shopping-cart-page-view` User viewing a shopping cart.
+     * * `impression` List of items displayed. Used by Google Tag Manager.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart` Products being added to cart.
+     * * `add-to-list` Items being added to a list (shopping list, favorites
+     *   etc).
+     * * `category-page-view` Special pages such as sale or promotion pages
+     *   viewed.
+     * * `checkout-start` User starting a checkout process.
+     * * `detail-page-view` Products detail page viewed.
+     * * `home-page-view` Homepage viewed.
+     * * `page-visit` Generic page visits not included in the event types above.
+     * * `purchase-complete` User finishing a purchase.
+     * * `refund` Purchased items being refunded or returned.
+     * * `remove-from-cart` Products being removed from cart.
+     * * `remove-from-list` Items being removed from a list.
+     * * `search` Product search.
+     * * `shopping-cart-page-view` User viewing a shopping cart.
+     * * `impression` List of items displayed. Used by Google Tag Manager.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart` Products being added to cart.
+     * * `add-to-list` Items being added to a list (shopping list, favorites
+     *   etc).
+     * * `category-page-view` Special pages such as sale or promotion pages
+     *   viewed.
+     * * `checkout-start` User starting a checkout process.
+     * * `detail-page-view` Products detail page viewed.
+     * * `home-page-view` Homepage viewed.
+     * * `page-visit` Generic page visits not included in the event types above.
+     * * `purchase-complete` User finishing a purchase.
+     * * `refund` Purchased items being refunded or returned.
+     * * `remove-from-cart` Products being removed from cart.
+     * * `remove-from-list` Items being removed from a list.
+     * * `search` Product search.
+     * * `shopping-cart-page-view` User viewing a shopping cart.
+     * * `impression` List of items displayed. Used by Google Tag Manager.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart` Products being added to cart.
+     * * `add-to-list` Items being added to a list (shopping list, favorites
+     *   etc).
+     * * `category-page-view` Special pages such as sale or promotion pages
+     *   viewed.
+     * * `checkout-start` User starting a checkout process.
+     * * `detail-page-view` Products detail page viewed.
+     * * `home-page-view` Homepage viewed.
+     * * `page-visit` Generic page visits not included in the event types above.
+     * * `purchase-complete` User finishing a purchase.
+     * * `refund` Purchased items being refunded or returned.
+     * * `remove-from-cart` Products being removed from cart.
+     * * `remove-from-list` Items being removed from a list.
+     * * `search` Product search.
+     * * `shopping-cart-page-view` User viewing a shopping cart.
+     * * `impression` List of items displayed. Used by Google Tag Manager.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventType_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserInfo, + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder, + com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userInfo. + */ + public com.google.cloud.recommendationengine.v1beta1.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserInfo(com.google.cloud.recommendationengine.v1beta1.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserInfo( + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserInfo(com.google.cloud.recommendationengine.v1beta1.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.recommendationengine.v1beta1.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * Required. User information.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserInfo, + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder, + com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserInfo, + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder, + com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.EventDetail eventDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.EventDetail, + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder> + eventDetailBuilder_; + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventDetail field is set. + */ + public boolean hasEventDetail() { + return eventDetailBuilder_ != null || eventDetail_ != null; + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventDetail. + */ + public com.google.cloud.recommendationengine.v1beta1.EventDetail getEventDetail() { + if (eventDetailBuilder_ == null) { + return eventDetail_ == null + ? com.google.cloud.recommendationengine.v1beta1.EventDetail.getDefaultInstance() + : eventDetail_; + } else { + return eventDetailBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventDetail(com.google.cloud.recommendationengine.v1beta1.EventDetail value) { + if (eventDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventDetail_ = value; + onChanged(); + } else { + eventDetailBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventDetail( + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder builderForValue) { + if (eventDetailBuilder_ == null) { + eventDetail_ = builderForValue.build(); + onChanged(); + } else { + eventDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEventDetail( + com.google.cloud.recommendationengine.v1beta1.EventDetail value) { + if (eventDetailBuilder_ == null) { + if (eventDetail_ != null) { + eventDetail_ = + com.google.cloud.recommendationengine.v1beta1.EventDetail.newBuilder(eventDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + eventDetail_ = value; + } + onChanged(); + } else { + eventDetailBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEventDetail() { + if (eventDetailBuilder_ == null) { + eventDetail_ = null; + onChanged(); + } else { + eventDetail_ = null; + eventDetailBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder + getEventDetailBuilder() { + + onChanged(); + return getEventDetailFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder + getEventDetailOrBuilder() { + if (eventDetailBuilder_ != null) { + return eventDetailBuilder_.getMessageOrBuilder(); + } else { + return eventDetail_ == null + ? com.google.cloud.recommendationengine.v1beta1.EventDetail.getDefaultInstance() + : eventDetail_; + } + } + /** + * + * + *
+     * Optional. User event detailed information common across different
+     * recommendation types.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.EventDetail, + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder> + getEventDetailFieldBuilder() { + if (eventDetailBuilder_ == null) { + eventDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.EventDetail, + com.google.cloud.recommendationengine.v1beta1.EventDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder>( + getEventDetail(), getParentForChildren(), isClean()); + eventDetail_ = null; + } + return eventDetailBuilder_; + } + + private com.google.cloud.recommendationengine.v1beta1.ProductEventDetail productEventDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder> + productEventDetailBuilder_; + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the productEventDetail field is set. + */ + public boolean hasProductEventDetail() { + return productEventDetailBuilder_ != null || productEventDetail_ != null; + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The productEventDetail. + */ + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail + getProductEventDetail() { + if (productEventDetailBuilder_ == null) { + return productEventDetail_ == null + ? com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance() + : productEventDetail_; + } else { + return productEventDetailBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setProductEventDetail( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail value) { + if (productEventDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productEventDetail_ = value; + onChanged(); + } else { + productEventDetailBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setProductEventDetail( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder builderForValue) { + if (productEventDetailBuilder_ == null) { + productEventDetail_ = builderForValue.build(); + onChanged(); + } else { + productEventDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeProductEventDetail( + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail value) { + if (productEventDetailBuilder_ == null) { + if (productEventDetail_ != null) { + productEventDetail_ = + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.newBuilder( + productEventDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + productEventDetail_ = value; + } + onChanged(); + } else { + productEventDetailBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearProductEventDetail() { + if (productEventDetailBuilder_ == null) { + productEventDetail_ = null; + onChanged(); + } else { + productEventDetail_ = null; + productEventDetailBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder + getProductEventDetailBuilder() { + + onChanged(); + return getProductEventDetailFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder + getProductEventDetailOrBuilder() { + if (productEventDetailBuilder_ != null) { + return productEventDetailBuilder_.getMessageOrBuilder(); + } else { + return productEventDetail_ == null + ? com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance() + : productEventDetail_; + } + } + /** + * + * + *
+     * Optional. Retail product specific user event metadata.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `add-to-list`
+     * * `category-page-view`
+     * * `checkout-start`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `refund`
+     * * `remove-from-cart`
+     * * `remove-from-list`
+     * * `search`
+     * This field is optional for the following event types:
+     * * `page-visit`
+     * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+     *   set for this unless the shopping cart is empty.
+     * This field is not allowed for the following event types:
+     * * `home-page-view`
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder> + getProductEventDetailFieldBuilder() { + if (productEventDetailBuilder_ == null) { + productEventDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder, + com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder>( + getProductEventDetail(), getParentForChildren(), isClean()); + productEventDetail_ = null; + } + return productEventDetailBuilder_; + } + + private com.google.protobuf.Timestamp eventTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + eventTimeBuilder_; + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTimeBuilder_ != null || eventTime_ != null; + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + if (eventTimeBuilder_ == null) { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } else { + return eventTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTime_ = value; + onChanged(); + } else { + eventTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (eventTimeBuilder_ == null) { + eventTime_ = builderForValue.build(); + onChanged(); + } else { + eventTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (eventTime_ != null) { + eventTime_ = + com.google.protobuf.Timestamp.newBuilder(eventTime_).mergeFrom(value).buildPartial(); + } else { + eventTime_ = value; + } + onChanged(); + } else { + eventTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEventTime() { + if (eventTimeBuilder_ == null) { + eventTime_ = null; + onChanged(); + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { + + onChanged(); + return getEventTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + if (eventTimeBuilder_ != null) { + return eventTimeBuilder_.getMessageOrBuilder(); + } else { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + } + /** + * + * + *
+     * Optional. Only required for ImportUserEvents method. Timestamp of user
+     * event created.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEventTimeFieldBuilder() { + if (eventTimeBuilder_ == null) { + eventTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEventTime(), getParentForChildren(), isClean()); + eventTime_ = null; + } + return eventTimeBuilder_; + } + + private int eventSource_ = 0; + /** + * + * + *
+     * Optional. This field should *not* be set when using JavaScript pixel
+     * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for eventSource. + */ + public int getEventSourceValue() { + return eventSource_; + } + /** + * + * + *
+     * Optional. This field should *not* be set when using JavaScript pixel
+     * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for eventSource to set. + * @return This builder for chaining. + */ + public Builder setEventSourceValue(int value) { + eventSource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. This field should *not* be set when using JavaScript pixel
+     * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventSource. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource getEventSource() { + @SuppressWarnings("deprecation") + com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource result = + com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource.valueOf(eventSource_); + return result == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. This field should *not* be set when using JavaScript pixel
+     * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The eventSource to set. + * @return This builder for chaining. + */ + public Builder setEventSource( + com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource value) { + if (value == null) { + throw new NullPointerException(); + } + + eventSource_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. This field should *not* be set when using JavaScript pixel
+     * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearEventSource() { + + eventSource_ = 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.recommendationengine.v1beta1.UserEvent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.UserEvent) + private static final com.google.cloud.recommendationengine.v1beta1.UserEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.UserEvent(); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEvent(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.recommendationengine.v1beta1.UserEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventImportSummary.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventImportSummary.java new file mode 100644 index 00000000..3a261a9d --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventImportSummary.java @@ -0,0 +1,650 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * A summary of import result. The UserEventImportSummary summarizes
+ * the import status for user events.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserEventImportSummary} + */ +public final class UserEventImportSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.UserEventImportSummary) + UserEventImportSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventImportSummary.newBuilder() to construct. + private UserEventImportSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventImportSummary() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventImportSummary(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventImportSummary( + 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: + { + joinedEventsCount_ = input.readInt64(); + break; + } + case 16: + { + unjoinedEventsCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.class, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder.class); + } + + public static final int JOINED_EVENTS_COUNT_FIELD_NUMBER = 1; + private long joinedEventsCount_; + /** + * + * + *
+   * Count of user events imported with complete existing catalog information.
+   * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + + public static final int UNJOINED_EVENTS_COUNT_FIELD_NUMBER = 2; + private long unjoinedEventsCount_; + /** + * + * + *
+   * Count of user events imported, but with catalog information not found
+   * in the imported catalog.
+   * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + + 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 (joinedEventsCount_ != 0L) { + output.writeInt64(1, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + output.writeInt64(2, unjoinedEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (joinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, unjoinedEventsCount_); + } + 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.recommendationengine.v1beta1.UserEventImportSummary)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary other = + (com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary) obj; + + if (getJoinedEventsCount() != other.getJoinedEventsCount()) return false; + if (getUnjoinedEventsCount() != other.getUnjoinedEventsCount()) 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) + JOINED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getJoinedEventsCount()); + hash = (37 * hash) + UNJOINED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUnjoinedEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary 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.recommendationengine.v1beta1.UserEventImportSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary 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.recommendationengine.v1beta1.UserEventImportSummary parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary 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.recommendationengine.v1beta1.UserEventImportSummary + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + 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.recommendationengine.v1beta1.UserEventImportSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary 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.recommendationengine.v1beta1.UserEventImportSummary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A summary of import result. The UserEventImportSummary summarizes
+   * the import status for user events.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserEventImportSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.UserEventImportSummary) + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.class, + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary.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(); + joinedEventsCount_ = 0L; + + unjoinedEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventImportSummary_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary build() { + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary buildPartial() { + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary result = + new com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary(this); + result.joinedEventsCount_ = joinedEventsCount_; + result.unjoinedEventsCount_ = unjoinedEventsCount_; + 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.recommendationengine.v1beta1.UserEventImportSummary) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + .getDefaultInstance()) return this; + if (other.getJoinedEventsCount() != 0L) { + setJoinedEventsCount(other.getJoinedEventsCount()); + } + if (other.getUnjoinedEventsCount() != 0L) { + setUnjoinedEventsCount(other.getUnjoinedEventsCount()); + } + 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.recommendationengine.v1beta1.UserEventImportSummary parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long joinedEventsCount_; + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @param value The joinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setJoinedEventsCount(long value) { + + joinedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearJoinedEventsCount() { + + joinedEventsCount_ = 0L; + onChanged(); + return this; + } + + private long unjoinedEventsCount_; + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @param value The unjoinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setUnjoinedEventsCount(long value) { + + unjoinedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearUnjoinedEventsCount() { + + unjoinedEventsCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.UserEventImportSummary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.UserEventImportSummary) + private static final com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary(); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventImportSummary + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventImportSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventImportSummary(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.recommendationengine.v1beta1.UserEventImportSummary + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventImportSummaryOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventImportSummaryOrBuilder.java new file mode 100644 index 00000000..f44d4ccd --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventImportSummaryOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface UserEventImportSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.UserEventImportSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Count of user events imported with complete existing catalog information.
+   * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + long getJoinedEventsCount(); + + /** + * + * + *
+   * Count of user events imported, but with catalog information not found
+   * in the imported catalog.
+   * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + long getUnjoinedEventsCount(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventInlineSource.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventInlineSource.java new file mode 100644 index 00000000..721f7c96 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventInlineSource.java @@ -0,0 +1,1021 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * The inline source for the input config for ImportUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserEventInlineSource} + */ +public final class UserEventInlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.UserEventInlineSource) + UserEventInlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventInlineSource.newBuilder() to construct. + private UserEventInlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventInlineSource() { + userEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventInlineSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventInlineSource( + 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)) { + userEvents_ = + new java.util.ArrayList< + com.google.cloud.recommendationengine.v1beta1.UserEvent>(); + mutable_bitField0_ |= 0x00000001; + } + userEvents_.add( + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEvent.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.class, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder.class); + } + + public static final int USER_EVENTS_FIELD_NUMBER = 1; + private java.util.List userEvents_; + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getUserEventsList() { + return userEvents_; + } + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getUserEventsOrBuilderList() { + return userEvents_; + } + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getUserEventsCount() { + return userEvents_.size(); + } + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvents(int index) { + return userEvents_.get(index); + } + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsOrBuilder( + int index) { + return userEvents_.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 < userEvents_.size(); i++) { + output.writeMessage(1, userEvents_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < userEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, userEvents_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource other = + (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) obj; + + if (!getUserEventsList().equals(other.getUserEventsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUserEventsCount() > 0) { + hash = (37 * hash) + USER_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getUserEventsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource 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.recommendationengine.v1beta1.UserEventInlineSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource 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.recommendationengine.v1beta1.UserEventInlineSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource 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.recommendationengine.v1beta1.UserEventInlineSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + 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.recommendationengine.v1beta1.UserEventInlineSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource 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.recommendationengine.v1beta1.UserEventInlineSource 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 inline source for the input config for ImportUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserEventInlineSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.UserEventInlineSource) + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.class, + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserEventsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + userEventsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.Import + .internal_static_google_cloud_recommendationengine_v1beta1_UserEventInlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource build() { + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource buildPartial() { + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource result = + new com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource(this); + int from_bitField0_ = bitField0_; + if (userEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.userEvents_ = userEvents_; + } else { + result.userEvents_ = userEventsBuilder_.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.recommendationengine.v1beta1.UserEventInlineSource) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + .getDefaultInstance()) return this; + if (userEventsBuilder_ == null) { + if (!other.userEvents_.isEmpty()) { + if (userEvents_.isEmpty()) { + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUserEventsIsMutable(); + userEvents_.addAll(other.userEvents_); + } + onChanged(); + } + } else { + if (!other.userEvents_.isEmpty()) { + if (userEventsBuilder_.isEmpty()) { + userEventsBuilder_.dispose(); + userEventsBuilder_ = null; + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + userEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUserEventsFieldBuilder() + : null; + } else { + userEventsBuilder_.addAllMessages(other.userEvents_); + } + } + } + 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.recommendationengine.v1beta1.UserEventInlineSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List userEvents_ = + java.util.Collections.emptyList(); + + private void ensureUserEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + userEvents_ = + new java.util.ArrayList( + userEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + userEventsBuilder_; + + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getUserEventsList() { + if (userEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(userEvents_); + } else { + return userEventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getUserEventsCount() { + if (userEventsBuilder_ == null) { + return userEvents_.size(); + } else { + return userEventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvents(int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUserEvents( + int index, com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.set(index, value); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUserEvents( + int index, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addUserEvents(com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(value); + onChanged(); + } else { + userEventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addUserEvents( + int index, com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(index, value); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addUserEvents( + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addUserEvents( + int index, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllUserEvents( + java.lang.Iterable + values) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, userEvents_); + onChanged(); + } else { + userEventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUserEvents() { + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + userEventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeUserEvents(int index) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.remove(index); + onChanged(); + } else { + userEventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder getUserEventsBuilder( + int index) { + return getUserEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsOrBuilder( + int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventsOrBuilderList() { + if (userEventsBuilder_ != null) { + return userEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(userEvents_); + } + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder addUserEventsBuilder() { + return getUserEventsFieldBuilder() + .addBuilder(com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder addUserEventsBuilder( + int index) { + return getUserEventsFieldBuilder() + .addBuilder( + index, com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getUserEventsBuilderList() { + return getUserEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventsFieldBuilder() { + if (userEventsBuilder_ == null) { + userEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder>( + userEvents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + userEvents_ = null; + } + return userEventsBuilder_; + } + + @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.recommendationengine.v1beta1.UserEventInlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.UserEventInlineSource) + private static final com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource(); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserEventInlineSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventInlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventInlineSource(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.recommendationengine.v1beta1.UserEventInlineSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventInlineSourceOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventInlineSourceOrBuilder.java new file mode 100644 index 00000000..014044fd --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventInlineSourceOrBuilder.java @@ -0,0 +1,88 @@ +/* + * 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/recommendationengine/v1beta1/import.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface UserEventInlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.UserEventInlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getUserEventsList(); + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvents(int index); + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getUserEventsCount(); + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getUserEventsOrBuilderList(); + /** + * + * + *
+   * Optional. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventsOrBuilder( + int index); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventOrBuilder.java new file mode 100644 index 00000000..997e680d --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventOrBuilder.java @@ -0,0 +1,332 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface UserEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.UserEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart` Products being added to cart.
+   * * `add-to-list` Items being added to a list (shopping list, favorites
+   *   etc).
+   * * `category-page-view` Special pages such as sale or promotion pages
+   *   viewed.
+   * * `checkout-start` User starting a checkout process.
+   * * `detail-page-view` Products detail page viewed.
+   * * `home-page-view` Homepage viewed.
+   * * `page-visit` Generic page visits not included in the event types above.
+   * * `purchase-complete` User finishing a purchase.
+   * * `refund` Purchased items being refunded or returned.
+   * * `remove-from-cart` Products being removed from cart.
+   * * `remove-from-list` Items being removed from a list.
+   * * `search` Product search.
+   * * `shopping-cart-page-view` User viewing a shopping cart.
+   * * `impression` List of items displayed. Used by Google Tag Manager.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart` Products being added to cart.
+   * * `add-to-list` Items being added to a list (shopping list, favorites
+   *   etc).
+   * * `category-page-view` Special pages such as sale or promotion pages
+   *   viewed.
+   * * `checkout-start` User starting a checkout process.
+   * * `detail-page-view` Products detail page viewed.
+   * * `home-page-view` Homepage viewed.
+   * * `page-visit` Generic page visits not included in the event types above.
+   * * `purchase-complete` User finishing a purchase.
+   * * `refund` Purchased items being refunded or returned.
+   * * `remove-from-cart` Products being removed from cart.
+   * * `remove-from-list` Items being removed from a list.
+   * * `search` Product search.
+   * * `shopping-cart-page-view` User viewing a shopping cart.
+   * * `impression` List of items displayed. Used by Google Tag Manager.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Required. User information.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * Required. User information.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userInfo. + */ + com.google.cloud.recommendationengine.v1beta1.UserInfo getUserInfo(); + /** + * + * + *
+   * Required. User information.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Optional. User event detailed information common across different
+   * recommendation types.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventDetail field is set. + */ + boolean hasEventDetail(); + /** + * + * + *
+   * Optional. User event detailed information common across different
+   * recommendation types.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventDetail. + */ + com.google.cloud.recommendationengine.v1beta1.EventDetail getEventDetail(); + /** + * + * + *
+   * Optional. User event detailed information common across different
+   * recommendation types.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.EventDetailOrBuilder getEventDetailOrBuilder(); + + /** + * + * + *
+   * Optional. Retail product specific user event metadata.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `category-page-view`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * * `search`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+   *   set for this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `home-page-view`
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the productEventDetail field is set. + */ + boolean hasProductEventDetail(); + /** + * + * + *
+   * Optional. Retail product specific user event metadata.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `category-page-view`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * * `search`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+   *   set for this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `home-page-view`
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The productEventDetail. + */ + com.google.cloud.recommendationengine.v1beta1.ProductEventDetail getProductEventDetail(); + /** + * + * + *
+   * Optional. Retail product specific user event metadata.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `add-to-list`
+   * * `category-page-view`
+   * * `checkout-start`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `refund`
+   * * `remove-from-cart`
+   * * `remove-from-list`
+   * * `search`
+   * This field is optional for the following event types:
+   * * `page-visit`
+   * * `shopping-cart-page-view` - note that 'product_event_detail' should be
+   *   set for this unless the shopping cart is empty.
+   * This field is not allowed for the following event types:
+   * * `home-page-view`
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder + getProductEventDetailOrBuilder(); + + /** + * + * + *
+   * Optional. Only required for ImportUserEvents method. Timestamp of user
+   * event created.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventTime field is set. + */ + boolean hasEventTime(); + /** + * + * + *
+   * Optional. Only required for ImportUserEvents method. Timestamp of user
+   * event created.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventTime. + */ + com.google.protobuf.Timestamp getEventTime(); + /** + * + * + *
+   * Optional. Only required for ImportUserEvents method. Timestamp of user
+   * event created.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); + + /** + * + * + *
+   * Optional. This field should *not* be set when using JavaScript pixel
+   * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for eventSource. + */ + int getEventSourceValue(); + /** + * + * + *
+   * Optional. This field should *not* be set when using JavaScript pixel
+   * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventSource. + */ + com.google.cloud.recommendationengine.v1beta1.UserEvent.EventSource getEventSource(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventOuterClass.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventOuterClass.java new file mode 100644 index 00000000..95473837 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventOuterClass.java @@ -0,0 +1,249 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class UserEventOuterClass { + private UserEventOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_TaxesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_TaxesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_CostsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_CostsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n:google/cloud/recommendationengine/v1be" + + "ta1/user_event.proto\022)google.cloud.recom" + + "mendationengine.v1beta1\032\037google/api/fiel" + + "d_behavior.proto\0327google/cloud/recommend" + + "ationengine/v1beta1/catalog.proto\0326googl" + + "e/cloud/recommendationengine/v1beta1/com" + + "mon.proto\032\037google/protobuf/timestamp.pro" + + "to\032\034google/api/annotations.proto\"\222\004\n\tUse" + + "rEvent\022\027\n\nevent_type\030\001 \001(\tB\003\340A\002\022K\n\tuser_" + + "info\030\002 \001(\01323.google.cloud.recommendation" + + "engine.v1beta1.UserInfoB\003\340A\002\022Q\n\014event_de" + + "tail\030\003 \001(\01326.google.cloud.recommendation" + + "engine.v1beta1.EventDetailB\003\340A\001\022`\n\024produ" + + "ct_event_detail\030\004 \001(\0132=.google.cloud.rec" + + "ommendationengine.v1beta1.ProductEventDe" + + "tailB\003\340A\001\0223\n\nevent_time\030\005 \001(\0132\032.google.p" + + "rotobuf.TimestampB\003\340A\001\022[\n\014event_source\030\006" + + " \001(\0162@.google.cloud.recommendationengine" + + ".v1beta1.UserEvent.EventSourceB\003\340A\001\"X\n\013E" + + "ventSource\022\034\n\030EVENT_SOURCE_UNSPECIFIED\020\000" + + "\022\n\n\006AUTOML\020\001\022\r\n\tECOMMERCE\020\002\022\020\n\014BATCH_UPL" + + "OAD\020\003\"\215\001\n\010UserInfo\022\027\n\nvisitor_id\030\001 \001(\tB\003" + + "\340A\002\022\024\n\007user_id\030\002 \001(\tB\003\340A\001\022\027\n\nip_address\030" + + "\003 \001(\tB\003\340A\001\022\027\n\nuser_agent\030\004 \001(\tB\003\340A\001\022 \n\023d" + + "irect_user_request\030\005 \001(\010B\003\340A\001\"\353\001\n\013EventD" + + "etail\022\020\n\003uri\030\001 \001(\tB\003\340A\001\022\031\n\014referrer_uri\030" + + "\006 \001(\tB\003\340A\001\022\031\n\014page_view_id\030\002 \001(\tB\003\340A\001\022\033\n" + + "\016experiment_ids\030\003 \003(\tB\003\340A\001\022!\n\024recommenda" + + "tion_token\030\004 \001(\tB\003\340A\001\022T\n\020event_attribute" + + "s\030\005 \001(\01325.google.cloud.recommendationeng" + + "ine.v1beta1.FeatureMapB\003\340A\001\"\352\002\n\022ProductE" + + "ventDetail\022\024\n\014search_query\030\001 \001(\t\022a\n\017page" + + "_categories\030\002 \003(\0132H.google.cloud.recomme" + + "ndationengine.v1beta1.CatalogItem.Catego" + + "ryHierarchy\022Q\n\017product_details\030\003 \003(\01328.g" + + "oogle.cloud.recommendationengine.v1beta1" + + ".ProductDetail\022\017\n\007list_id\030\004 \001(\t\022\024\n\007cart_" + + "id\030\005 \001(\tB\003\340A\001\022a\n\024purchase_transaction\030\006 " + + "\001(\0132>.google.cloud.recommendationengine." + + "v1beta1.PurchaseTransactionB\003\340A\001\"\362\002\n\023Pur" + + "chaseTransaction\022\017\n\002id\030\001 \001(\tB\003\340A\001\022\024\n\007rev" + + "enue\030\002 \001(\002B\003\340A\002\022]\n\005taxes\030\003 \003(\0132I.google." + + "cloud.recommendationengine.v1beta1.Purch" + + "aseTransaction.TaxesEntryB\003\340A\001\022]\n\005costs\030" + + "\004 \003(\0132I.google.cloud.recommendationengin" + + "e.v1beta1.PurchaseTransaction.CostsEntry" + + "B\003\340A\001\022\032\n\rcurrency_code\030\006 \001(\tB\003\340A\002\032,\n\nTax" + + "esEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\032" + + ",\n\nCostsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" + + "\002:\0028\001\"\346\002\n\rProductDetail\022\017\n\002id\030\001 \001(\tB\003\340A\002" + + "\022\032\n\rcurrency_code\030\002 \001(\tB\003\340A\001\022\033\n\016original" + + "_price\030\003 \001(\002B\003\340A\001\022\032\n\rdisplay_price\030\004 \001(\002" + + "B\003\340A\001\022b\n\013stock_state\030\005 \001(\0162H.google.clou" + + "d.recommendationengine.v1beta1.ProductCa" + + "talogItem.StockStateB\003\340A\001\022\025\n\010quantity\030\006 " + + "\001(\005B\003\340A\001\022\037\n\022available_quantity\030\007 \001(\005B\003\340A" + + "\001\022S\n\017item_attributes\030\010 \001(\01325.google.clou" + + "d.recommendationengine.v1beta1.FeatureMa" + + "pB\003\340A\001B\304\001\n-com.google.cloud.recommendati" + + "onengine.v1beta1P\001Z]google.golang.org/ge" + + "nproto/googleapis/cloud/recommendationen" + + "gine/v1beta1;recommendationengine\242\002\005RECA" + + "I\252\002)Google.Cloud.RecommendationEngine.V1" + + "Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Catalog.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Common.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_UserEvent_descriptor, + new java.lang.String[] { + "EventType", + "UserInfo", + "EventDetail", + "ProductEventDetail", + "EventTime", + "EventSource", + }); + internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor, + new java.lang.String[] { + "VisitorId", "UserId", "IpAddress", "UserAgent", "DirectUserRequest", + }); + internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_EventDetail_descriptor, + new java.lang.String[] { + "Uri", + "ReferrerUri", + "PageViewId", + "ExperimentIds", + "RecommendationToken", + "EventAttributes", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor, + new java.lang.String[] { + "SearchQuery", + "PageCategories", + "ProductDetails", + "ListId", + "CartId", + "PurchaseTransaction", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor, + new java.lang.String[] { + "Id", "Revenue", "Taxes", "Costs", "CurrencyCode", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_TaxesEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_TaxesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_TaxesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_CostsEntry_descriptor = + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_CostsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PurchaseTransaction_CostsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ProductDetail_descriptor, + new java.lang.String[] { + "Id", + "CurrencyCode", + "OriginalPrice", + "DisplayPrice", + "StockState", + "Quantity", + "AvailableQuantity", + "ItemAttributes", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Catalog.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Common.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceOuterClass.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceOuterClass.java new file mode 100644 index 00000000..b0fa862c --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceOuterClass.java @@ -0,0 +1,233 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public final class UserEventServiceOuterClass { + private UserEventServiceOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nBgoogle/cloud/recommendationengine/v1be" + + "ta1/user_event_service.proto\022)google.clo" + + "ud.recommendationengine.v1beta1\032\034google/" + + "api/annotations.proto\032\037google/api/field_" + + "behavior.proto\032\031google/api/httpbody.prot" + + "o\0326google/cloud/recommendationengine/v1b" + + "eta1/import.proto\032:google/cloud/recommen" + + "dationengine/v1beta1/user_event.proto\032#g" + + "oogle/longrunning/operations.proto\032\037goog" + + "le/protobuf/timestamp.proto\032\026google/type" + + "/date.proto\032\027google/api/client.proto\"V\n\026" + + "PurgeUserEventsRequest\022\023\n\006parent\030\001 \001(\tB\003" + + "\340A\002\022\023\n\006filter\030\002 \001(\tB\003\340A\002\022\022\n\005force\030\003 \001(\010B" + + "\003\340A\001\"b\n\027PurgeUserEventsMetadata\022\026\n\016opera" + + "tion_name\030\001 \001(\t\022/\n\013create_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\"\210\001\n\027PurgeUserEv" + + "entsResponse\022\033\n\023purged_events_count\030\001 \001(" + + "\003\022P\n\022user_events_sample\030\002 \003(\01324.google.c" + + "loud.recommendationengine.v1beta1.UserEv" + + "ent\"{\n\025WriteUserEventRequest\022\023\n\006parent\030\001" + + " \001(\tB\003\340A\002\022M\n\nuser_event\030\002 \001(\01324.google.c" + + "loud.recommendationengine.v1beta1.UserEv" + + "entB\003\340A\002\"k\n\027CollectUserEventRequest\022\023\n\006p" + + "arent\030\001 \001(\tB\003\340A\002\022\027\n\nuser_event\030\002 \001(\tB\003\340A" + + "\002\022\020\n\003uri\030\003 \001(\tB\003\340A\001\022\020\n\003ets\030\004 \001(\003B\003\340A\001\"r\n" + + "\025ListUserEventsRequest\022\023\n\006parent\030\001 \001(\tB\003" + + "\340A\002\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_toke" + + "n\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\"|\n\026Lis" + + "tUserEventsResponse\022I\n\013user_events\030\001 \003(\013" + + "24.google.cloud.recommendationengine.v1b" + + "eta1.UserEvent\022\027\n\017next_page_token\030\002 \001(\t2" + + "\323\013\n\020UserEventService\022\360\001\n\016WriteUserEvent\022" + + "@.google.cloud.recommendationengine.v1be" + + "ta1.WriteUserEventRequest\0324.google.cloud" + + ".recommendationengine.v1beta1.UserEvent\"" + + "f\202\323\344\223\002`\"R/v1beta1/{parent=projects/*/loc" + + "ations/*/catalogs/*/eventStores/*}/userE" + + "vents:write:\nuser_event\022\312\001\n\020CollectUserE" + + "vent\022B.google.cloud.recommendationengine" + + ".v1beta1.CollectUserEventRequest\032\024.googl" + + "e.api.HttpBody\"\\\202\323\344\223\002V\022T/v1beta1/{parent" + + "=projects/*/locations/*/catalogs/*/event" + + "Stores/*}/userEvents:collect\022\353\001\n\016ListUse" + + "rEvents\022@.google.cloud.recommendationeng" + + "ine.v1beta1.ListUserEventsRequest\032A.goog" + + "le.cloud.recommendationengine.v1beta1.Li" + + "stUserEventsResponse\"T\202\323\344\223\002N\022L/v1beta1/{" + + "parent=projects/*/locations/*/catalogs/*" + + "/eventStores/*}/userEvents\022\335\002\n\017PurgeUser" + + "Events\022A.google.cloud.recommendationengi" + + "ne.v1beta1.PurgeUserEventsRequest\032\035.goog" + + "le.longrunning.Operation\"\347\001\202\323\344\223\002W\"R/v1be" + + "ta1/{parent=projects/*/locations/*/catal" + + "ogs/*/eventStores/*}/userEvents:purge:\001*" + + "\312A\206\001\nAgoogle.cloud.recommendationengine." + + "v1beta1.PurgeUserEventsResponse\022Agoogle." + + "cloud.recommendationengine.v1beta1.Purge" + + "UserEventsMetadata\022\327\002\n\020ImportUserEvents\022" + + "B.google.cloud.recommendationengine.v1be" + + "ta1.ImportUserEventsRequest\032\035.google.lon" + + "grunning.Operation\"\337\001\202\323\344\223\002X\"S/v1beta1/{p" + + "arent=projects/*/locations/*/catalogs/*/" + + "eventStores/*}/userEvents:import:\001*\312A~\nB" + + "google.cloud.recommendationengine.v1beta" + + "1.ImportUserEventsResponse\0228google.cloud" + + ".recommendationengine.v1beta1.ImportMeta" + + "data\032W\312A#recommendationengine.googleapis" + + ".com\322A.https://www.googleapis.com/auth/c" + + "loud-platformB\304\001\n-com.google.cloud.recom" + + "mendationengine.v1beta1P\001Z]google.golang" + + ".org/genproto/googleapis/cloud/recommend" + + "ationengine/v1beta1;recommendationengine" + + "\242\002\005RECAI\252\002)Google.Cloud.RecommendationEn" + + "gine.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.HttpBodyProto.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.Import.getDescriptor(), + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "Force", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsMetadata_descriptor, + new java.lang.String[] { + "OperationName", "CreateTime", + }); + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_PurgeUserEventsResponse_descriptor, + new java.lang.String[] { + "PurgedEventsCount", "UserEventsSample", + }); + internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEvent", + }); + internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_CollectUserEventRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEvent", "Uri", "Ets", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recommendationengine_v1beta1_ListUserEventsResponse_descriptor, + new java.lang.String[] { + "UserEvents", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.HttpBodyProto.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.Import.getDescriptor(); + com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserInfo.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserInfo.java new file mode 100644 index 00000000..3f049e5c --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserInfo.java @@ -0,0 +1,1358 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Information of end users.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserInfo} + */ +public final class UserInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.UserInfo) + UserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserInfo.newBuilder() to construct. + private UserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserInfo() { + visitorId_ = ""; + userId_ = ""; + ipAddress_ = ""; + userAgent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserInfo( + 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(); + + visitorId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + userId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + userAgent_ = s; + break; + } + case 40: + { + directUserRequest_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserInfo.class, + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder.class); + } + + public static final int VISITOR_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required. A unique identifier for tracking visitors with a length limit of
+   * 128 bytes.
+   * For example, this could be implemented with a http cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * Maximum length 128 bytes. Cannot be empty.
+   * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A unique identifier for tracking visitors with a length limit of
+   * 128 bytes.
+   * For example, this could be implemented with a http cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * Maximum length 128 bytes. Cannot be empty.
+   * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object userId_; + /** + * + * + *
+   * Optional. Unique identifier for logged-in user with a length limit of 128
+   * bytes. Required only for logged-in users.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + 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(); + userId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Unique identifier for logged-in user with a length limit of 128
+   * bytes. Required only for logged-in users.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 3; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+   * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+   * set when using the javascript pixel or if `direct_user_request` is set.
+   * Used to extract location information for personalization.
+   * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+   * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+   * set when using the javascript pixel or if `direct_user_request` is set.
+   * Used to extract location information for personalization.
+   * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_AGENT_FIELD_NUMBER = 4; + private volatile java.lang.Object userAgent_; + /** + * + * + *
+   * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+   * with a length limit of 1 KiB.
+   * This should *not* be set when using the JavaScript pixel or if
+   * `directUserRequest` is set.
+   * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The userAgent. + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + 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(); + userAgent_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+   * with a length limit of 1 KiB.
+   * This should *not* be set when using the JavaScript pixel or if
+   * `directUserRequest` is set.
+   * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for userAgent. + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIRECT_USER_REQUEST_FIELD_NUMBER = 5; + private boolean directUserRequest_; + /** + * + * + *
+   * Optional. Indicates if the request is made directly from the end user
+   * in which case the user_agent and ip_address fields can be populated
+   * from the HTTP request. This should *not* be set when using the javascript
+   * pixel. This flag should be set only if the API request is made directly
+   * from the end user such as a mobile app (and not if a gateway or a server is
+   * processing and pushing the user events).
+   * 
+ * + * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The directUserRequest. + */ + public boolean getDirectUserRequest() { + return directUserRequest_; + } + + 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 (!getVisitorIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, visitorId_); + } + if (!getUserIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userId_); + } + if (!getIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ipAddress_); + } + if (!getUserAgentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userAgent_); + } + if (directUserRequest_ != false) { + output.writeBool(5, directUserRequest_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVisitorIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, visitorId_); + } + if (!getUserIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userId_); + } + if (!getIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ipAddress_); + } + if (!getUserAgentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userAgent_); + } + if (directUserRequest_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, directUserRequest_); + } + 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.recommendationengine.v1beta1.UserInfo)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.UserInfo other = + (com.google.cloud.recommendationengine.v1beta1.UserInfo) obj; + + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getUserId().equals(other.getUserId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getUserAgent().equals(other.getUserAgent())) return false; + if (getDirectUserRequest() != other.getDirectUserRequest()) 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) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (37 * hash) + DIRECT_USER_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectUserRequest()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo 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.recommendationengine.v1beta1.UserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo 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.recommendationengine.v1beta1.UserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo 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.recommendationengine.v1beta1.UserInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo 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.recommendationengine.v1beta1.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo 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.recommendationengine.v1beta1.UserInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information of end users.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.UserInfo) + com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.UserInfo.class, + com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder.class); + } + + // Construct using com.google.cloud.recommendationengine.v1beta1.UserInfo.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(); + visitorId_ = ""; + + userId_ = ""; + + ipAddress_ = ""; + + userAgent_ = ""; + + directUserRequest_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserInfo getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserInfo build() { + com.google.cloud.recommendationengine.v1beta1.UserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.UserInfo buildPartial() { + com.google.cloud.recommendationengine.v1beta1.UserInfo result = + new com.google.cloud.recommendationengine.v1beta1.UserInfo(this); + result.visitorId_ = visitorId_; + result.userId_ = userId_; + result.ipAddress_ = ipAddress_; + result.userAgent_ = userAgent_; + result.directUserRequest_ = directUserRequest_; + 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.recommendationengine.v1beta1.UserInfo) { + return mergeFrom((com.google.cloud.recommendationengine.v1beta1.UserInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.UserInfo other) { + if (other == com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance()) + return this; + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + onChanged(); + } + if (other.getDirectUserRequest() != false) { + setDirectUserRequest(other.getDirectUserRequest()); + } + 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.recommendationengine.v1beta1.UserInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.UserInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required. A unique identifier for tracking visitors with a length limit of
+     * 128 bytes.
+     * For example, this could be implemented with a http cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * Maximum length 128 bytes. Cannot be empty.
+     * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors with a length limit of
+     * 128 bytes.
+     * For example, this could be implemented with a http cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * Maximum length 128 bytes. Cannot be empty.
+     * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors with a length limit of
+     * 128 bytes.
+     * For example, this could be implemented with a http cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * Maximum length 128 bytes. Cannot be empty.
+     * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors with a length limit of
+     * 128 bytes.
+     * For example, this could be implemented with a http cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * Maximum length 128 bytes. Cannot be empty.
+     * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors with a length limit of
+     * 128 bytes.
+     * For example, this could be implemented with a http cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * Maximum length 128 bytes. Cannot be empty.
+     * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Optional. Unique identifier for logged-in user with a length limit of 128
+     * bytes. Required only for logged-in users.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Unique identifier for logged-in user with a length limit of 128
+     * bytes. Required only for logged-in users.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Unique identifier for logged-in user with a length limit of 128
+     * bytes. Required only for logged-in users.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique identifier for logged-in user with a length limit of 128
+     * bytes. Required only for logged-in users.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + + userId_ = getDefaultInstance().getUserId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique identifier for logged-in user with a length limit of 128
+     * bytes. Required only for logged-in users.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userId_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+     * set when using the javascript pixel or if `direct_user_request` is set.
+     * Used to extract location information for personalization.
+     * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+     * set when using the javascript pixel or if `direct_user_request` is set.
+     * Used to extract location information for personalization.
+     * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+     * set when using the javascript pixel or if `direct_user_request` is set.
+     * Used to extract location information for personalization.
+     * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+     * set when using the javascript pixel or if `direct_user_request` is set.
+     * Used to extract location information for personalization.
+     * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+     * set when using the javascript pixel or if `direct_user_request` is set.
+     * Used to extract location information for personalization.
+     * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object userAgent_ = ""; + /** + * + * + *
+     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+     * with a length limit of 1 KiB.
+     * This should *not* be set when using the JavaScript pixel or if
+     * `directUserRequest` is set.
+     * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The userAgent. + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+     * with a length limit of 1 KiB.
+     * This should *not* be set when using the JavaScript pixel or if
+     * `directUserRequest` is set.
+     * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for userAgent. + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+     * with a length limit of 1 KiB.
+     * This should *not* be set when using the JavaScript pixel or if
+     * `directUserRequest` is set.
+     * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+     * with a length limit of 1 KiB.
+     * This should *not* be set when using the JavaScript pixel or if
+     * `directUserRequest` is set.
+     * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUserAgent() { + + userAgent_ = getDefaultInstance().getUserAgent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+     * with a length limit of 1 KiB.
+     * This should *not* be set when using the JavaScript pixel or if
+     * `directUserRequest` is set.
+     * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userAgent_ = value; + onChanged(); + return this; + } + + private boolean directUserRequest_; + /** + * + * + *
+     * Optional. Indicates if the request is made directly from the end user
+     * in which case the user_agent and ip_address fields can be populated
+     * from the HTTP request. This should *not* be set when using the javascript
+     * pixel. This flag should be set only if the API request is made directly
+     * from the end user such as a mobile app (and not if a gateway or a server is
+     * processing and pushing the user events).
+     * 
+ * + * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The directUserRequest. + */ + public boolean getDirectUserRequest() { + return directUserRequest_; + } + /** + * + * + *
+     * Optional. Indicates if the request is made directly from the end user
+     * in which case the user_agent and ip_address fields can be populated
+     * from the HTTP request. This should *not* be set when using the javascript
+     * pixel. This flag should be set only if the API request is made directly
+     * from the end user such as a mobile app (and not if a gateway or a server is
+     * processing and pushing the user events).
+     * 
+ * + * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The directUserRequest to set. + * @return This builder for chaining. + */ + public Builder setDirectUserRequest(boolean value) { + + directUserRequest_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Indicates if the request is made directly from the end user
+     * in which case the user_agent and ip_address fields can be populated
+     * from the HTTP request. This should *not* be set when using the javascript
+     * pixel. This flag should be set only if the API request is made directly
+     * from the end user such as a mobile app (and not if a gateway or a server is
+     * processing and pushing the user events).
+     * 
+ * + * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDirectUserRequest() { + + directUserRequest_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.UserInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.UserInfo) + private static final com.google.cloud.recommendationengine.v1beta1.UserInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.UserInfo(); + } + + public static com.google.cloud.recommendationengine.v1beta1.UserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserInfo(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.recommendationengine.v1beta1.UserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserInfoOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserInfoOrBuilder.java new file mode 100644 index 00000000..900e9849 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserInfoOrBuilder.java @@ -0,0 +1,167 @@ +/* + * 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/recommendationengine/v1beta1/user_event.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface UserInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.UserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A unique identifier for tracking visitors with a length limit of
+   * 128 bytes.
+   * For example, this could be implemented with a http cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * Maximum length 128 bytes. Cannot be empty.
+   * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required. A unique identifier for tracking visitors with a length limit of
+   * 128 bytes.
+   * For example, this could be implemented with a http cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * Maximum length 128 bytes. Cannot be empty.
+   * 
+ * + * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * Optional. Unique identifier for logged-in user with a length limit of 128
+   * bytes. Required only for logged-in users.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The userId. + */ + java.lang.String getUserId(); + /** + * + * + *
+   * Optional. Unique identifier for logged-in user with a length limit of 128
+   * bytes. Required only for logged-in users.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + /** + * + * + *
+   * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+   * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+   * set when using the javascript pixel or if `direct_user_request` is set.
+   * Used to extract location information for personalization.
+   * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
+   * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
+   * set when using the javascript pixel or if `direct_user_request` is set.
+   * Used to extract location information for personalization.
+   * 
+ * + * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+   * with a length limit of 1 KiB.
+   * This should *not* be set when using the JavaScript pixel or if
+   * `directUserRequest` is set.
+   * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The userAgent. + */ + java.lang.String getUserAgent(); + /** + * + * + *
+   * Optional. User agent as included in the HTTP header. UTF-8 encoded string
+   * with a length limit of 1 KiB.
+   * This should *not* be set when using the JavaScript pixel or if
+   * `directUserRequest` is set.
+   * 
+ * + * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for userAgent. + */ + com.google.protobuf.ByteString getUserAgentBytes(); + + /** + * + * + *
+   * Optional. Indicates if the request is made directly from the end user
+   * in which case the user_agent and ip_address fields can be populated
+   * from the HTTP request. This should *not* be set when using the javascript
+   * pixel. This flag should be set only if the API request is made directly
+   * from the end user such as a mobile app (and not if a gateway or a server is
+   * processing and pushing the user events).
+   * 
+ * + * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The directUserRequest. + */ + boolean getDirectUserRequest(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/WriteUserEventRequest.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/WriteUserEventRequest.java new file mode 100644 index 00000000..7f73443f --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/WriteUserEventRequest.java @@ -0,0 +1,954 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +/** + * + * + *
+ * Request message for WriteUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.WriteUserEventRequest} + */ +public final class WriteUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) + WriteUserEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteUserEventRequest.newBuilder() to construct. + private WriteUserEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteUserEventRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteUserEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteUserEventRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder subBuilder = null; + if (userEvent_ != null) { + subBuilder = userEvent_.toBuilder(); + } + userEvent_ = + input.readMessage( + com.google.cloud.recommendationengine.v1beta1.UserEvent.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userEvent_); + userEvent_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest.class, + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.recommendationengine.v1beta1.UserEvent userEvent_; + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEvent_ != null; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventOrBuilder() { + return getUserEvent(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (userEvent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + 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.recommendationengine.v1beta1.WriteUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest other = + (com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasUserEvent()) { + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest 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.recommendationengine.v1beta1.WriteUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest 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.recommendationengine.v1beta1.WriteUserEventRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest 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.recommendationengine.v1beta1.WriteUserEventRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + 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.recommendationengine.v1beta1.WriteUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest 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.recommendationengine.v1beta1.WriteUserEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for WriteUserEvent method.
+   * 
+ * + * Protobuf type {@code google.cloud.recommendationengine.v1beta1.WriteUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest.class, + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest.Builder.class); + } + + // Construct using + // com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest.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(); + parent_ = ""; + + if (userEventBuilder_ == null) { + userEvent_ = null; + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.recommendationengine.v1beta1.UserEventServiceOuterClass + .internal_static_google_cloud_recommendationengine_v1beta1_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + getDefaultInstanceForType() { + return com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest build() { + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest buildPartial() { + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest result = + new com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest(this); + result.parent_ = parent_; + if (userEventBuilder_ == null) { + result.userEvent_ = userEvent_; + } else { + result.userEvent_ = userEventBuilder_.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.recommendationengine.v1beta1.WriteUserEventRequest) { + return mergeFrom( + (com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest other) { + if (other + == com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + 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.recommendationengine.v1beta1.WriteUserEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent eventStore resource name, such as
+     * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.recommendationengine.v1beta1.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEventBuilder_ != null || userEvent_ != null; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + onChanged(); + } else { + userEventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent( + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + onChanged(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.recommendationengine.v1beta1.UserEvent value) { + if (userEventBuilder_ == null) { + if (userEvent_ != null) { + userEvent_ = + com.google.cloud.recommendationengine.v1beta1.UserEvent.newBuilder(userEvent_) + .mergeFrom(value) + .buildPartial(); + } else { + userEvent_ = value; + } + onChanged(); + } else { + userEventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + if (userEventBuilder_ == null) { + userEvent_ = null; + onChanged(); + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder getUserEventBuilder() { + + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder + getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.recommendationengine.v1beta1.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.recommendationengine.v1beta1.UserEvent, + com.google.cloud.recommendationengine.v1beta1.UserEvent.Builder, + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + @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.recommendationengine.v1beta1.WriteUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) + private static final com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest(); + } + + public static com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteUserEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteUserEventRequest(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.recommendationengine.v1beta1.WriteUserEventRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/WriteUserEventRequestOrBuilder.java b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/WriteUserEventRequestOrBuilder.java new file mode 100644 index 00000000..a7167220 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/java/com/google/cloud/recommendationengine/v1beta1/WriteUserEventRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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/recommendationengine/v1beta1/user_event_service.proto + +package com.google.cloud.recommendationengine.v1beta1; + +public interface WriteUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recommendationengine.v1beta1.WriteUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent eventStore resource name, such as
+   * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.recommendationengine.v1beta1.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.recommendationengine.v1beta1.UserEventOrBuilder getUserEventOrBuilder(); +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/catalog.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/catalog.proto new file mode 100644 index 00000000..cfabb6c0 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/catalog.proto @@ -0,0 +1,197 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/recommendationengine/v1beta1/common.proto"; +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// CatalogItem captures all metadata information of items to be recommended. +message CatalogItem { + // Category represents catalog item category hierarchy. + message CategoryHierarchy { + // Required. Catalog item categories. Each category should be a UTF-8 + // encoded string with a length limit of 2 KiB. + // + // Note that the order in the list denotes the specificity (from least to + // most specific). + repeated string categories = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Catalog item identifier. UTF-8 encoded string with a length limit + // of 128 bytes. + // + // This id must be unique among all catalog items within the same catalog. It + // should also be used when logging user events in order for the user events + // to be joined with the Catalog. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Catalog item categories. This field is repeated for supporting + // one catalog item belonging to several parallel category hierarchies. + // + // For example, if a shoes product belongs to both + // ["Shoes & Accessories" -> "Shoes"] and + // ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + // represented as: + // + // "categoryHierarchies": [ + // { "categories": ["Shoes & Accessories", "Shoes"]}, + // { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } + // ] + repeated CategoryHierarchy category_hierarchies = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Catalog item title. UTF-8 encoded string with a length limit of 1 + // KiB. + string title = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Catalog item description. UTF-8 encoded string with a length + // limit of 5 KiB. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Highly encouraged. Extra catalog item attributes to be + // included in the recommendation model. For example, for retail products, + // this could include the store name, vendor, style, color, etc. These are + // very strong signals for recommendation model, thus we highly recommend + // providing the item attributes here. + FeatureMap item_attributes = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Language of the title/description/item_attributes. Use language + // tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our + // supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', + // 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact + // your Google account manager. + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering tags associated with the catalog item. Each tag should + // be a UTF-8 encoded string with a length limit of 1 KiB. + // + // This tag can be used for filtering recommendation results by passing the + // tag as part of the predict request filter. + repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Variant group identifier for prediction results. UTF-8 encoded + // string with a length limit of 128 bytes. + // + // This field must be enabled before it can be used. [Learn + // more](/recommendations-ai/docs/catalog#item-group-id). + string item_group_id = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Extra catalog item metadata for different recommendation types. + oneof recommendation_type { + // Optional. Metadata specific to retail products. + ProductCatalogItem product_metadata = 10 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// ProductCatalogItem captures item metadata specific to retail products. +message ProductCatalogItem { + // Exact product price. + message ExactPrice { + // Optional. Display price of the product. + float display_price = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Price of the product without any discount. If zero, by default + // set to be the 'displayPrice'. + float original_price = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Product price range when there are a range of prices for different + // variations of the same product. + message PriceRange { + // Required. The minimum product price. + float min = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum product price. + float max = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Item stock state. If this field is unspecified, the item is + // assumed to be in stock. + enum StockState { + option allow_alias = true; + + // Default item stock status. Should never be used. + STOCK_STATE_UNSPECIFIED = 0; + + // Item in stock. + IN_STOCK = 0; + + // Item out of stock. + OUT_OF_STOCK = 1; + + // Item that is in pre-order state. + PREORDER = 2; + + // Item that is back-ordered (i.e. temporarily out of stock). + BACKORDER = 3; + } + + // Product price. Only one of 'exactPrice'/'priceRange' can be provided. + oneof price { + // Optional. The exact product price. + ExactPrice exact_price = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The product price range. + PriceRange price_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A map to pass the costs associated with the product. + // + // For example: + // {"manufacturing": 45.5} The profit of selling this item is computed like + // so: + // + // * If 'exactPrice' is provided, profit = displayPrice - sum(costs) + // * If 'priceRange' is provided, profit = minPrice - sum(costs) + map costs = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only required if the price is set. Currency code for price/costs. Use + // three-character ISO-4217 code. + string currency_code = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Online stock state of the catalog item. Default is `IN_STOCK`. + StockState stock_state = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The available quantity of the item. + int64 available_quantity = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Canonical URL directly linking to the item detail page with a + // length limit of 5 KiB.. + string canonical_product_uri = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Product images for the catalog item. + repeated Image images = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Catalog item thumbnail/detail image. +message Image { + // Required. URL of the image with a length limit of 5 KiB. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Height of the image in number of pixels. + int32 height = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Width of the image in number of pixels. + int32 width = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/catalog_service.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/catalog_service.proto new file mode 100644 index 00000000..a23d8d21 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/catalog_service.proto @@ -0,0 +1,162 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/recommendationengine/v1beta1/catalog.proto"; +import "google/cloud/recommendationengine/v1beta1/import.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// Service for ingesting catalog information of the customer's website. +service CatalogService { + option (google.api.default_host) = "recommendationengine.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a catalog item. + rpc CreateCatalogItem(CreateCatalogItemRequest) returns (CatalogItem) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems" + body: "catalog_item" + }; + } + + // Gets a specific catalog item. + rpc GetCatalogItem(GetCatalogItemRequest) returns (CatalogItem) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of catalog items. + rpc ListCatalogItems(ListCatalogItemsRequest) returns (ListCatalogItemsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems" + }; + } + + // Updates a catalog item. Partial updating is supported. Non-existing + // items will be created. + rpc UpdateCatalogItem(UpdateCatalogItemRequest) returns (CatalogItem) { + option (google.api.http) = { + patch: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}" + body: "catalog_item" + }; + option (google.api.method_signature) = "catalog_item,update_mask"; + } + + // Deletes a catalog item. + rpc DeleteCatalogItem(DeleteCatalogItemRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Bulk import of multiple catalog items. Request processing may be + // synchronous. No partial updating supported. Non-existing items will be + // created. + // + // Operation.response is of type ImportResponse. Note that it is + // possible for a subset of the items to be successfully updated. + rpc ImportCatalogItems(ImportCatalogItemsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse" + metadata_type: "google.cloud.recommendationengine.v1beta1.ImportMetadata" + }; + } +} + +// Request message for CreateCatalogItem method. +message CreateCatalogItemRequest { + // Required. The parent catalog resource name, such as + // "projects/*/locations/global/catalogs/default_catalog". + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The catalog item to create. + CatalogItem catalog_item = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetCatalogItem method. +message GetCatalogItemRequest { + // Required. Full resource name of catalog item, such as + // "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id". + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListCatalogItems method. +message ListCatalogItemsRequest { + // Required. The parent catalog resource name, such as + // "projects/*/locations/global/catalogs/default_catalog". + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of results to return per page. If zero, the + // service will choose a reasonable default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The previous ListCatalogItemsResponse.next_page_token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter to apply on the list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListCatalogItems method. +message ListCatalogItemsResponse { + // The catalog items. + repeated CatalogItem catalog_items = 1; + + // If empty, the list is complete. If nonempty, the token to pass to the next + // request's ListCatalogItemRequest.page_token. + string next_page_token = 2; +} + +// Request message for UpdateCatalogItem method. +message UpdateCatalogItemRequest { + // Required. Full resource name of catalog item, such as + // "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The catalog item to update/create. The 'catalog_item_id' field + // has to match that in the 'name'. + CatalogItem catalog_item = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Indicates which fields in the provided 'item' to update. If not + // set, will by default update all fields. + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteCatalogItem method. +message DeleteCatalogItemRequest { + // Required. Full resource name of catalog item, such as + // "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/common.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/common.proto new file mode 100644 index 00000000..4fb2ba4b --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/common.proto @@ -0,0 +1,61 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// FeatureMap represents extra features that customers want to include in the +// recommendation model for catalogs/user events as categorical/numerical +// features. +message FeatureMap { + // A list of string features. + message StringList { + // String feature value with a length limit of 128 bytes. + repeated string value = 1; + } + + // A list of float features. + message FloatList { + // Float feature value. + repeated float value = 1; + } + + // Categorical features that can take on one of a limited number of possible + // values. Some examples would be the brand/maker of a product, or country of + // a customer. + // + // Feature names and values must be UTF-8 encoded strings. + // + // For example: `{ "colors": {"value": ["yellow", "green"]}, + // "sizes": {"value":["S", "M"]}` + map categorical_features = 1; + + // Numerical features. Some examples would be the height/weight of a product, + // or age of a customer. + // + // Feature names must be UTF-8 encoded strings. + // + // For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, + // "heights_cm": {"value":[8.1, 6.4]} }` + map numerical_features = 2; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/import.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/import.proto new file mode 100644 index 00000000..d8a8fe54 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/import.proto @@ -0,0 +1,182 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/recommendationengine/v1beta1/catalog.proto"; +import "google/cloud/recommendationengine/v1beta1/user_event.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// Google Cloud Storage location for input content. +// format. +message GcsSource { + // Required. Google Cloud Storage URIs to input files. URI can be up to + // 2000 characters long. URIs can match the full object path (for example, + // gs://bucket/directory/object.json) or a pattern matching one or more + // files, such as gs://bucket/directory/*.json. A request can + // contain at most 100 files, and each file can be up to 2 GB. See + // [Importing catalog information](/recommendations-ai/docs/upload-catalog) + // for the expected file format and setup instructions. + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The inline source for the input config for ImportCatalogItems method. +message CatalogInlineSource { + // Optional. A list of catalog items to update/create. Recommended max of 10k + // items. + repeated CatalogItem catalog_items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The inline source for the input config for ImportUserEvents method. +message UserEventInlineSource { + // Optional. A list of user events to import. Recommended max of 10k items. + repeated UserEvent user_events = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration of destination for Import related errors. +message ImportErrorsConfig { + // Required. Errors destination. + oneof destination { + // Google Cloud Storage path for import errors. This must be an empty, + // existing Cloud Storage bucket. Import errors will be written to a file in + // this bucket, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Request message for Import methods. +message ImportCatalogItemsRequest { + // Required. "projects/1234/locations/global/catalogs/default_catalog" + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Unique identifier provided by client, within the ancestor + // dataset scope. Ensures idempotency and used for request deduplication. + // Server-generated if unspecified. Up to 128 characters long. This is + // returned as google.longrunning.Operation.name in the response. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The desired input location of the data. + InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The desired location of errors incurred during the Import. + ImportErrorsConfig errors_config = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the ImportUserEvents request. +message ImportUserEventsRequest { + // Required. "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store" + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Unique identifier provided by client, within the ancestor + // dataset scope. Ensures idempotency for expensive long running operations. + // Server-generated if unspecified. Up to 128 characters long. This is + // returned as google.longrunning.Operation.name in the response. Note that + // this field must not be set if the desired input config is + // catalog_inline_source. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The desired input location of the data. + InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The desired location of errors incurred during the Import. + ImportErrorsConfig errors_config = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The input config source. +message InputConfig { + // Required. The source of the input. + oneof source { + // The Inline source for the input content for Catalog items. + CatalogInlineSource catalog_inline_source = 1; + + // Google Cloud Storage location for the input content. + GcsSource gcs_source = 2; + + // The Inline source for the input content for UserEvents. + UserEventInlineSource user_event_inline_source = 3; + } +} + +// Metadata related to the progress of the Import operation. This will be +// returned by the google.longrunning.Operation.metadata field. +message ImportMetadata { + // Name of the operation. + string operation_name = 5; + + // Id of the request / operation. This is parroting back the requestId that + // was passed in the request. + string request_id = 3; + + // Operation create time. + google.protobuf.Timestamp create_time = 4; + + // Count of entries that were processed successfully. + int64 success_count = 1; + + // Count of entries that encountered errors while processing. + int64 failure_count = 2; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 6; +} + +// Response of the ImportCatalogItemsRequest. If the long running +// operation is done, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportCatalogItemsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors in the request if set. + ImportErrorsConfig errors_config = 2; +} + +// Response of the ImportUserEventsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportUserEventsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors if this field was set in + // the request. + ImportErrorsConfig errors_config = 2; + + // Aggregated statistics of user event import status. + UserEventImportSummary import_summary = 3; +} + +// A summary of import result. The UserEventImportSummary summarizes +// the import status for user events. +message UserEventImportSummary { + // Count of user events imported with complete existing catalog information. + int64 joined_events_count = 1; + + // Count of user events imported, but with catalog information not found + // in the imported catalog. + int64 unjoined_events_count = 2; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto new file mode 100644 index 00000000..b1462422 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto @@ -0,0 +1,107 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/protobuf/empty.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// Service for registering API keys for use with the `predict` method. If you +// use an API key to request predictions, you must first register the API key. +// Otherwise, your prediction request is rejected. If you use OAuth to +// authenticate your `predict` method call, you do not need to register an API +// key. You can register up to 20 API keys per project. +service PredictionApiKeyRegistry { + option (google.api.default_host) = "recommendationengine.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Register an API key for use with predict method. + rpc CreatePredictionApiKeyRegistration(CreatePredictionApiKeyRegistrationRequest) returns (PredictionApiKeyRegistration) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations" + body: "*" + }; + } + + // List the registered apiKeys for use with predict method. + rpc ListPredictionApiKeyRegistrations(ListPredictionApiKeyRegistrationsRequest) returns (ListPredictionApiKeyRegistrationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations" + }; + } + + // Unregister an apiKey from using for predict method. + rpc DeletePredictionApiKeyRegistration(DeletePredictionApiKeyRegistrationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}" + }; + } +} + +// Registered Api Key. +message PredictionApiKeyRegistration { + // The API key. + string api_key = 1; +} + +// Request message for the `CreatePredictionApiKeyRegistration` method. +message CreatePredictionApiKeyRegistrationRequest { + // Required. The parent resource path. + // "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store". + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The prediction API key registration. + PredictionApiKeyRegistration prediction_api_key_registration = 2; +} + +// Request message for the `ListPredictionApiKeyRegistrations`. +message ListPredictionApiKeyRegistrationsRequest { + // Required. The parent placement resource name such as + // "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store" + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of results to return per page. If unset, the + // service will choose a reasonable default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListPredictionApiKeyRegistrations`. +message ListPredictionApiKeyRegistrationsResponse { + // The list of registered API keys. + repeated PredictionApiKeyRegistration prediction_api_key_registrations = 1; + + // If empty, the list is complete. If nonempty, pass the token to the next + // request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. + string next_page_token = 2; +} + +// Request message for `DeletePredictionApiKeyRegistration` method. +message DeletePredictionApiKeyRegistrationRequest { + // Required. The API key to unregister including full resource path. + // "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/" + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/prediction_service.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/prediction_service.proto new file mode 100644 index 00000000..4182bf09 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/prediction_service.proto @@ -0,0 +1,187 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/recommendationengine/v1beta1/user_event.proto"; +import "google/protobuf/struct.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// Service for making recommendation prediction. +service PredictionService { + option (google.api.default_host) = "recommendationengine.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Makes a recommendation prediction. If using API Key based authentication, + // the API Key must be registered using the + // [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] + // service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict" + body: "*" + }; + } +} + +// Request message for Predict method. +message PredictRequest { + // Required. Full resource name of the format: + // {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*} + // The id of the recommendation engine placement. This id is used to identify + // the set of models that will be used to make the prediction. + // + // We currently support three placements with the following IDs by default: + // + // * `shopping_cart`: Predicts items frequently bought together with one or + // more catalog items in the same shopping session. Commonly displayed after + // `add-to-cart` events, on product detail pages, or on the shopping cart + // page. + // + // * `home_page`: Predicts the next product that a user will most likely + // engage with or purchase based on the shopping or viewing history of the + // specified `userId` or `visitorId`. For example - Recommendations for you. + // + // * `product_detail`: Predicts the next product that a user will most likely + // engage with or purchase. The prediction is based on the shopping or + // viewing history of the specified `userId` or `visitorId` and its + // relevance to a specified `CatalogItem`. Typically used on product detail + // pages. For example - More items like this. + // + // * `recently_viewed_default`: Returns up to 75 items recently viewed by the + // specified `userId` or `visitorId`, most recent ones first. Returns + // nothing if neither of them has viewed any items yet. For example - + // Recently viewed. + // + // The full list of available placements can be seen at + // https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Context about the user, what they are looking at and what action + // they took to trigger the predict request. Note that this user event detail + // won't be ingested to userEvent logs. Thus, a separate userEvent write + // request is required for event logging. + UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of results to return per page. Set this property + // to the number of prediction results required. If zero, the service will + // choose a reasonable default. + int32 page_size = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The previous PredictResponse.next_page_token. + string page_token = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter for restricting prediction results. Accepts values for + // tags and the `filterOutOfStockItems` flag. + // + // * Tag expressions. Restricts predictions to items that match all of the + // specified tags. Boolean operators `OR` and `NOT` are supported if the + // expression is enclosed in parentheses, and must be separated from the + // tag values by a space. `-"tagA"` is also supported and is equivalent to + // `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + // with a size limit of 1 KiB. + // + // * filterOutOfStockItems. Restricts predictions to items that do not have a + // stockState value of OUT_OF_STOCK. + // + // Examples: + // + // * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + // * filterOutOfStockItems tag=(-"promotional") + // * filterOutOfStockItems + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Use dryRun mode for this prediction query. If set to true, a + // dummy model will be used that returns arbitrary catalog items. + // Note that the dryRun mode should only be used for testing the API, or if + // the model is not ready. + bool dry_run = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional domain specific parameters for the predictions. + // + // Allowed values: + // + // * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + // object will be returned in the + // `PredictResponse.PredictionResult.itemMetadata` object in the method + // response. + // * `returnItemScore`: Boolean. If set to true, the prediction 'score' + // corresponding to each returned item will be set in the `metadata` + // field in the prediction response. The given 'score' indicates the + // probability of an item being clicked/purchased given the user's context + // and history. + map params = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels for the predict request. + // + // * Label keys can contain lowercase letters, digits and hyphens, must start + // with a letter, and must end with a letter or digit. + // * Non-zero label values can contain lowercase letters, digits and hyphens, + // must start with a letter, and must end with a letter or digit. + // * No more than 64 labels can be associated with a given request. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for predict method. +message PredictResponse { + // PredictionResult represents the recommendation prediction results. + message PredictionResult { + // ID of the recommended catalog item + string id = 1; + + // Additional item metadata / annotations. + // + // Possible values: + // + // * `catalogItem`: JSON representation of the catalogItem. Will be set if + // `returnCatalogItem` is set to true in `PredictRequest.params`. + // * `score`: Prediction score in double value. Will be set if + // `returnItemScore` is set to true in `PredictRequest.params`. + map item_metadata = 2; + } + + // A list of recommended items. The order represents the ranking (from the + // most relevant item to the least). + repeated PredictionResult results = 1; + + // A unique recommendation token. This should be included in the user event + // logs resulting from this recommendation, which enables accurate attribution + // of recommendation model performance. + string recommendation_token = 2; + + // IDs of items in the request that were missing from the catalog. + repeated string items_missing_in_catalog = 3; + + // True if the dryRun property was set in the request. + bool dry_run = 4; + + // Additional domain specific prediction response metadata. + map metadata = 5; + + // If empty, the list is complete. If nonempty, the token to pass to the next + // request's PredictRequest.page_token. + string next_page_token = 6; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/user_event.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/user_event.proto new file mode 100644 index 00000000..fd11b42a --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/user_event.proto @@ -0,0 +1,334 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/recommendationengine/v1beta1/catalog.proto"; +import "google/cloud/recommendationengine/v1beta1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// UserEvent captures all metadata information recommendation engine needs to +// know about how end users interact with customers' website. +message UserEvent { + // User event source. + enum EventSource { + // Unspecified event source. + EVENT_SOURCE_UNSPECIFIED = 0; + + // The event is ingested via a javascript pixel or Recommendations AI Tag + // through automl datalayer or JS Macros. + AUTOML = 1; + + // The event is ingested via Recommendations AI Tag through Enhanced + // Ecommerce datalayer. + ECOMMERCE = 2; + + // The event is ingested via Import user events API. + BATCH_UPLOAD = 3; + } + + // Required. User event type. Allowed values are: + // + // * `add-to-cart` Products being added to cart. + // * `add-to-list` Items being added to a list (shopping list, favorites + // etc). + // * `category-page-view` Special pages such as sale or promotion pages + // viewed. + // * `checkout-start` User starting a checkout process. + // * `detail-page-view` Products detail page viewed. + // * `home-page-view` Homepage viewed. + // * `page-visit` Generic page visits not included in the event types above. + // * `purchase-complete` User finishing a purchase. + // * `refund` Purchased items being refunded or returned. + // * `remove-from-cart` Products being removed from cart. + // * `remove-from-list` Items being removed from a list. + // * `search` Product search. + // * `shopping-cart-page-view` User viewing a shopping cart. + // * `impression` List of items displayed. Used by Google Tag Manager. + string event_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. User information. + UserInfo user_info = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User event detailed information common across different + // recommendation types. + EventDetail event_detail = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Retail product specific user event metadata. + // + // This field is required for the following event types: + // + // * `add-to-cart` + // * `add-to-list` + // * `category-page-view` + // * `checkout-start` + // * `detail-page-view` + // * `purchase-complete` + // * `refund` + // * `remove-from-cart` + // * `remove-from-list` + // * `search` + // + // This field is optional for the following event types: + // + // * `page-visit` + // * `shopping-cart-page-view` - note that 'product_event_detail' should be + // set for this unless the shopping cart is empty. + // + // This field is not allowed for the following event types: + // + // * `home-page-view` + ProductEventDetail product_event_detail = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only required for ImportUserEvents method. Timestamp of user + // event created. + google.protobuf.Timestamp event_time = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field should *not* be set when using JavaScript pixel + // or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. + EventSource event_source = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information of end users. +message UserInfo { + // Required. A unique identifier for tracking visitors with a length limit of + // 128 bytes. + // + // For example, this could be implemented with a http cookie, which should be + // able to uniquely identify a visitor on a single device. This unique + // identifier should not change if the visitor log in/out of the website. + // Maximum length 128 bytes. Cannot be empty. + string visitor_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Unique identifier for logged-in user with a length limit of 128 + // bytes. Required only for logged-in users. + string user_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or + // IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be + // set when using the javascript pixel or if `direct_user_request` is set. + // Used to extract location information for personalization. + string ip_address = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User agent as included in the HTTP header. UTF-8 encoded string + // with a length limit of 1 KiB. + // + // This should *not* be set when using the JavaScript pixel or if + // `directUserRequest` is set. + string user_agent = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if the request is made directly from the end user + // in which case the user_agent and ip_address fields can be populated + // from the HTTP request. This should *not* be set when using the javascript + // pixel. This flag should be set only if the API request is made directly + // from the end user such as a mobile app (and not if a gateway or a server is + // processing and pushing the user events). + bool direct_user_request = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// User event details shared by all recommendation types. +message EventDetail { + // Optional. Complete url (window.location.href) of the user's current page. + // When using the JavaScript pixel, this value is filled in automatically. + // Maximum length 5KB. + string uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The referrer url of the current page. When using + // the JavaScript pixel, this value is filled in automatically. + string referrer_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique id of a web page view. + // This should be kept the same for all user events triggered from the same + // pageview. For example, an item detail page view could trigger multiple + // events as the user is browsing the page. + // The `pageViewId` property should be kept the same for all these events so + // that they can be grouped together properly. This `pageViewId` will be + // automatically generated if using the JavaScript pixel. + string page_view_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of identifiers for the independent experiment groups + // this user event belongs to. This is used to distinguish between user events + // associated with different experiment setups (e.g. using Recommendation + // Engine system, using different recommendation models). + repeated string experiment_ids = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Recommendation token included in the recommendation prediction + // response. + // + // This field enables accurate attribution of recommendation model + // performance. + // + // This token enables us to accurately attribute page view or purchase back to + // the event and the particular predict response containing this + // clicked/purchased item. If user clicks on product K in the recommendation + // results, pass the `PredictResponse.recommendationToken` property as a url + // parameter to product K's page. When recording events on product K's page, + // log the PredictResponse.recommendation_token to this field. + // + // Optional, but highly encouraged for user events that are the result of a + // recommendation prediction query. + string recommendation_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Extra user event features to include in the recommendation + // model. + // + // For product recommendation, an example of extra user information is + // traffic_channel, i.e. how user arrives at the site. Users can arrive + // at the site by coming to the site directly, or coming through Google + // search, and etc. + FeatureMap event_attributes = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ProductEventDetail captures user event information specific to retail +// products. +message ProductEventDetail { + // Required for `search` events. Other event types should not set this field. + // The user's search query as UTF-8 encoded text with a length limit of 5 KiB. + string search_query = 1; + + // Required for `category-page-view` events. Other event types should not set + // this field. + // The categories associated with a category page. + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // categories : ["Sales", "2017 Black Friday Deals"]. + repeated CatalogItem.CategoryHierarchy page_categories = 2; + + // The main product details related to the event. + // + // This field is required for the following event types: + // + // * `add-to-cart` + // * `add-to-list` + // * `checkout-start` + // * `detail-page-view` + // * `purchase-complete` + // * `refund` + // * `remove-from-cart` + // * `remove-from-list` + // + // This field is optional for the following event types: + // + // * `page-visit` + // * `shopping-cart-page-view` - note that 'product_details' should be set for + // this unless the shopping cart is empty. + // + // This field is not allowed for the following event types: + // + // * `category-page-view` + // * `home-page-view` + // * `search` + repeated ProductDetail product_details = 3; + + // Required for `add-to-list` and `remove-from-list` events. The id or name of + // the list that the item is being added to or removed from. Other event types + // should not set this field. + string list_id = 4; + + // Optional. The id or name of the associated shopping cart. This id is used + // to associate multiple items added or present in the cart before purchase. + // + // This can only be set for `add-to-cart`, `remove-from-cart`, + // `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. + string cart_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A transaction represents the entire purchase transaction. + // Required for `purchase-complete` events. Optional for `checkout-start` + // events. Other event types should not set this field. + PurchaseTransaction purchase_transaction = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A transaction represents the entire purchase transaction. +message PurchaseTransaction { + // Optional. The transaction ID with a length limit of 128 bytes. + string id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Total revenue or grand total associated with the transaction. + // This value include shipping, tax, or other adjustments to total revenue + // that you want to include as part of your revenue calculations. This field + // is not required if the event type is `refund`. + float revenue = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. All the taxes associated with the transaction. + map taxes = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. All the costs associated with the product. These can be + // manufacturing costs, shipping expenses not borne by the end user, or any + // other costs. + // + // Total product cost such that + // profit = revenue - (sum(taxes) + sum(costs)) + // If product_cost is not set, then + // profit = revenue - tax - shipping - sum(CatalogItem.costs). + // + // If CatalogItem.cost is not specified for one of the items, CatalogItem.cost + // based profit *cannot* be calculated for this Transaction. + map costs = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Currency code. Use three-character ISO-4217 code. This field + // is not required if the event type is `refund`. + string currency_code = 6 [(google.api.field_behavior) = REQUIRED]; +} + +// Detailed product information associated with a user event. +message ProductDetail { + // Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 + // characters. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Currency code for price/costs. Use three-character ISO-4217 + // code. Required only if originalPrice or displayPrice is set. + string currency_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Original price of the product. If provided, this will override + // the original price in Catalog for this product. + float original_price = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Display price of the product (e.g. discounted price). If + // provided, this will override the display price in Catalog for this product. + float display_price = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Item stock state. If provided, this overrides the stock state + // in Catalog for items in this event. + ProductCatalogItem.StockState stock_state = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Quantity of the product associated with the user event. For + // example, this field will be 2 if two products are added to the shopping + // cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, + // `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event + // types. + int32 quantity = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Quantity of the products in stock when a user event happens. + // Optional. If provided, this overrides the available quantity in Catalog for + // this event. and can only be set if `stock_status` is set to `IN_STOCK`. + // + // Note that if an item is out of stock, you must set the `stock_state` field + // to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not + // sufficient to mark the item out of stock. + int32 available_quantity = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Extra features associated with a product in the user event. + FeatureMap item_attributes = 8 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/user_event_service.proto b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/user_event_service.proto new file mode 100644 index 00000000..12033693 --- /dev/null +++ b/proto-google-cloud-recommendations-ai-v1beta1/src/main/proto/google/cloud/recommendationengine/v1beta1/user_event_service.proto @@ -0,0 +1,242 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.recommendationengine.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/cloud/recommendationengine/v1beta1/import.proto"; +import "google/cloud/recommendationengine/v1beta1/user_event.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommendationengine.v1beta1"; +option objc_class_prefix = "RECAI"; + +// Service for ingesting end user actions on the customer website. +service UserEventService { + option (google.api.default_host) = "recommendationengine.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Writes a single user event. + rpc WriteUserEvent(WriteUserEventRequest) returns (UserEvent) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write" + body: "user_event" + }; + } + + // Writes a single user event from the browser. This uses a GET request to + // due to browser restriction of POST-ing to a 3rd party domain. + // + // This method is used only by the Recommendations AI JavaScript pixel. + // Users should not call this method directly. + rpc CollectUserEvent(CollectUserEventRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect" + }; + } + + // Gets a list of user events within a time range, with potential filtering. + rpc ListUserEvents(ListUserEventsRequest) returns (ListUserEventsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents" + }; + } + + // Deletes permanently all user events specified by the filter provided. + // Depending on the number of events specified by the filter, this operation + // could take hours or days to complete. To test a filter, use the list + // command first. + rpc PurgeUserEvents(PurgeUserEventsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse" + metadata_type: "google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata" + }; + } + + // Bulk import of User events. Request processing might be + // synchronous. Events that already exist are skipped. + // Use this method for backfilling historical user events. + // + // Operation.response is of type ImportResponse. Note that it is + // possible for a subset of the items to be successfully inserted. + // Operation.metadata is of type ImportMetadata. + rpc ImportUserEvents(ImportUserEventsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse" + metadata_type: "google.cloud.recommendationengine.v1beta1.ImportMetadata" + }; + } +} + +// Request message for PurgeUserEvents method. +message PurgeUserEventsRequest { + // Required. The resource name of the event_store under which the events are + // created. The format is + // "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}" + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The filter string to specify the events to be deleted. Empty + // string filter is not allowed. This filter can also be used with + // ListUserEvents API to list events that will be deleted. The eligible fields + // for filtering are: + // * eventType - UserEvent.eventType field of type string. + // * eventTime - in ISO 8601 "zulu" format. + // * visitorId - field of type string. Specifying this will delete all events + // associated with a visitor. + // * userId - field of type string. Specifying this will delete all events + // associated with a user. + // Example 1: Deleting all events in a time range. + // `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + // "2012-04-23T18:30:43.511Z"` + // Example 2: Deleting specific eventType in time range. + // `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + // Example 3: Deleting all events for a specific visitor + // `visitorId = visitor1024` + // The filtering fields are assumed to have an implicit AND. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The default value is false. Override this flag to true to + // actually perform the purge. If the field is not set to true, a sampling of + // events to be deleted will be returned. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata related to the progress of the PurgeUserEvents operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeUserEventsMetadata { + // The ID of the request / operation. + string operation_name = 1; + + // Operation create time. + google.protobuf.Timestamp create_time = 2; +} + +// Response of the PurgeUserEventsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +message PurgeUserEventsResponse { + // The total count of events purged as a result of the operation. + int64 purged_events_count = 1; + + // A sampling of events deleted (or will be deleted) depending on the `force` + // property in the request. Max of 500 items will be returned. + repeated UserEvent user_events_sample = 2; +} + +// Request message for WriteUserEvent method. +message WriteUserEventRequest { + // Required. The parent eventStore resource name, such as + // "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store". + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. User event to write. + UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CollectUserEvent method. +message CollectUserEventRequest { + // Required. The parent eventStore name, such as + // "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store". + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URL encoded UserEvent proto. + string user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The url including cgi-parameters but excluding the hash fragment. The URL + // must be truncated to 1.5K bytes to conservatively be under the 2K bytes. + // This is often more useful than the referer url, because many browsers only + // send the domain for 3rd party requests. + string uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The event timestamp in milliseconds. This prevents browser caching of + // otherwise identical get requests. The name is abbreviated to reduce the + // payload bytes. + int64 ets = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListUserEvents method. +message ListUserEventsRequest { + // Required. The parent eventStore resource name, such as + // "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store". + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of results to return per page. If zero, the + // service will choose a reasonable default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The previous ListUserEventsResponse.next_page_token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering expression to specify restrictions over + // returned events. This is a sequence of terms, where each term applies some + // kind of a restriction to the returned user events. Use this expression to + // restrict results to a specific time range, or filter events by eventType. + // eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + // eventTime<"2012-04-23T18:25:43.511Z" eventType=search + // + // We expect only 3 types of fields: + // + // * eventTime: this can be specified a maximum of 2 times, once with a + // less than operator and once with a greater than operator. The + // eventTime restrict should result in one contiguous valid eventTime + // range. + // + // * eventType: only 1 eventType restriction can be specified. + // + // * eventsMissingCatalogItems: specififying this will restrict results + // to events for which catalog items were not found in the catalog. The + // default behavior is to return only those events for which catalog + // items were found. + // + // Some examples of valid filters expressions: + // + // * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + // eventTime < "2012-04-23T18:30:43.511Z" + // * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + // eventType = detail-page-view + // * Example 3: eventsMissingCatalogItems + // eventType = search eventTime < "2018-04-23T18:30:43.511Z" + // * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + // * Example 5: eventType = search + // * Example 6: eventsMissingCatalogItems + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListUserEvents method. +message ListUserEventsResponse { + // The user events. + repeated UserEvent user_events = 1; + + // If empty, the list is complete. If nonempty, the token to pass to the next + // request's ListUserEvents.page_token. + string next_page_token = 2; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..fc641270 --- /dev/null +++ b/renovate.json @@ -0,0 +1,78 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:libraries-bom" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..e60c0b15 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + recommendationengine-install-without-bom + jar + Google Recommendations AI Install Without Bom + https://github.com/googleapis/java-recommendations-ai + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-recommendations-ai + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..b5bff84b --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-recommendationengine-samples + 0.0.1-SNAPSHOT + pom + Google Recommendations AI Samples Parent + https://github.com/googleapis/java-recommendations-ai + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..35968dc5 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + recommendationengine-snapshot + jar + Google Recommendations AI Snapshot Samples + https://github.com/googleapis/java-recommendations-ai + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-recommendations-ai + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..1a96d4d5 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + com.google.cloud + recommendationengine-snippets + jar + Google Recommendations AI Snippets + https://github.com/googleapis/java-recommendations-ai + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + + com.google.cloud + libraries-bom + 4.3.0 + pom + import + + + + + + + com.google.cloud + google-cloud-recommendations-ai + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..a3dfc652 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,31 @@ +{ + "updateTime": "2020-03-23T19:49:07.460094Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", + "internalRef": "302154871" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "recommendationengine", + "apiVersion": "v1beta1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..92070f6a --- /dev/null +++ b/synth.py @@ -0,0 +1,34 @@ +# 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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +service = 'recommendationengine' +versions = ['v1beta1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + package_pattern='com.google.cloud.{service}.{version}', + proto_path=f'google/cloud/{service}/{version}', + bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', + destination_name='recommendations-ai', + ) + +java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..fed55cbc --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-recommendations-ai:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-recommendations-ai-v1beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-recommendations-ai-v1beta1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file